How to create hidden Firefox Extension? - firefox

Is it possible to create Firewox extension that will not shown in Extensions List? And so cannot be deinstalled manually?

To Hide an extensions/addons in the list of extension about:addons simply follow these few simple steps:
(1) Create an a zipfile myextenios.zip (firefox extension are actually zip files) having this structure:
myextension.zip
|
|--chrome.manifest
|--install.rdf
|--[content]
|--hideExtensions.css
(2) The chrome.manifest should have this content:
content myextension content/
style chrome://mozapps/content/extensions/extensions.xul chrome://myextension/content/hideExtensions.css
style about:addons chrome://myextension/content/hideExtensions.css
(3) The install.rdf should have this content:
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>myextension#yoursite.de</em:id>
<em:name>myextension</em:name>
<em:description>This addon hides addons entries in about:addons</em:description>
<em:optionsURL></em:optionsURL>
<em:iconURL></em:iconURL>
<em:version>1.0</em:version>
<em:creator>your name</em:creator>
<em:homepageURL>http://www.yourside.de</em:homepageURL>
<em:type>2</em:type>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>4.0</em:minVersion>
<em:maxVersion>14.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
(4) Lastly the file hideExtensions.css has to have the following content:
(note: of course you might wanna adjust the name of the extension you want to hide)
.addon[name="1. Name of addon to hide"],
.addon[name="2. Name of addon to hide"],
.addon[name="3. Name of addon to hide"],
.addon[name="myextension"]
{
display:none;
}
(5) Rename the myextension.zip to myextension.xpi so that it recognized as a extension + install it by dragging the file into Firefox browser window.
Conclusion:
Most of the steps baove are equal to those of the creation of any other firefox extension. Therefore anybody with the knowledge to create an firefox addon/extension can also cause this extension not to show up in the addon list you see when you enter about:addons. Consequently if you have just one malicious firefox extension (virus) then you cannot trust Firefox as much to even see this virus-extension in the list.

See this mozillazine entry and this forum entry. These extensions are somehow installed via the registry and supposed to be malicious - so there's no use for this except if you want to be on some malware blacklist.
For private use or administration use like MSalters suggested in his comment, "hidden" (for some users) extensions could be useful, but this should be implemented by Mozilla first.

Related

Firefox extension testing and developing - I'm confused

when I'm writing extension for Google Chrome, I only create "manifest.json" file and JS file, which is my script. after installing , I can change anything in the code, I only refresh browser and I had changed version of extension.
1) Can I change some code after installing Firefox extension? Or should I reinstall it? Or should I need to reload it again - and how if its possible?
2) should I create install.rdf, chrome.manifest, *.xul files and so in by hand (whick folder structure and so on)? Or is there another simplest way to do this?
3) I don't understand, should i create extensions by "Add-on SDK" or write by hand with notepad? what is difference of them?
4) I'm writing simplest script, which invoke alert('hello world') when i open any page by browser. what is the best and fastest way to do this?
thanks a lot;
1) Can I change some code after installing Firefox extension? Or should I reinstall it? Or should I need to reload it again - and how if its possible?
Live updates are possible using <em:bootstrap>true</em:bootstrap> and bootstrap functions
2) should I create install.rdf, chrome.manifest, *.xul files and so in by hand (whick folder structure and so on)? Or is there another simplest way to do this?
Neither; modify an existing simple extension
3) I don't understand, should i create extensions by "Add-on SDK" or write by hand with notepad? what is difference of them?
Add-on SDK is an sdk; by hand is xul; depends on you
4) I'm writing simplest script, which invoke alert('hello world') when i open any page by browser. what is the best and fastest way to do this?
hello_world.xpi (chrome / content / hello.xul):
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<caption label="Hello World"/>
</window>
In addition, extension development tools should help.
References
Explore multithreaded programming in XUL

Firefox 6 Extension and Search Plugin bundle does not work

Adding a Search Plugin for Firefox Via Extension is done using bundles, putting your .xml OpeSearch in /searchplugins/ directory and Firefox will automatically add them when the Extension is installed.
See https://developer.mozilla.org/en/Bundles and also my own question Including a Search Plugin in my Firefox Extension
Well, it worked fine, until i started using Firefox 6. It seems that Firefox 6 does not read the /searchplugins/ directory anymore and does not add the Search Plugin. It might be also Firefox 4 and 5, i jumped from 3.6 to 6 directly.
Any idea if this is a bug in Firefox 6?
Any idea how to by pass it and install the SearchPlugin Anyway?
I think that the only relevant difference between Firefox 3.6 and Firefox 6 (Firefox 4 actually) is that by default extensions are no longer unpacked on installation, instead they are placed into user's profile as XPI files. This works for most extensions but particularly search plugins won't work from an XPI file. Which is why you have to add the unpack flag to your install.rdf file:
<Description about="urn:mozilla:install-manifest">
<em:id>...</em:id>
<em:unpack>true</em:unpack>
...
</Description>

Chrome/Firefox: access source of an extension

Do Chrome or Firefox make your extension's source code open to the host machine? And if yes where are the respective folder on Mac?
Yes, assuming some or all of your extension is written in an interpreted and un-obfuscated language. Plain Javascript is common for extensions in both browsers.
For any firefox extension, if you save the .xpi file instead of installing it, it is just a zip file and you can open it with any archive tool (e.g. 7zip or WinZip).
The same goes for the .crx files Chrome. As an test, I just downloaded and opened the .crx for Google Mail Checker Plus using 7zip, and it looks like this is entirely written in javascript and all the source can be read.
In either case, how much usable source code you can get from this depends on the language(s) that are used in the extension.
Google Chrome installs the extension into ~/Library/Application Support/Google/Chrome/Default/Extensions/<EXTENSION_ID>/ and registers it in its Preferences file (according to this).
As heb says, Firefox installs the extension to ~/Library/Application Support/Firefox/Profiles/PROFILE_ID/extensions/EXTENSION_ID/
For Firefox the path is:
/Users/YOUR_LOGIN/Library/Application Support/Firefox/Profiles/PROFILE_ID/extensions/EXTENSION_ID/
view online
View a Chrome/Firefox/Opera extension/addon’s source in browser (without downloading):
https://robwu.nl/crxviewer/
bookmarklets
bookmarklets usage
Click the bookmarklet when on an extension’s page in the Chrome Web Store, Firefox addon gallery or Opera addon gallery.
bookmarklets source code
load in same tab
javascript:location.href='https://robwu.nl/crxviewer/?crx='+location.href;
open in new tab
javascript:window.open('https://robwu.nl/crxviewer/?crx='+location.href,'_blank');
bookmarklets links
view extension source online (Chrome .crx) # https://robwu.nl/crxviewer/?crx= ← You can drag this link to your bookmark bar to create the bookmarklet, but you have to edit its URL afterwards: Delete everything before javascript, including the single slash: http://delete_me/
view extension source online in new tab (Chrome .crx) # https://robwu.nl/crxviewer/?crx=
I know it's an old topic but for future research.. it could be interesting..so following the link :
How to find extension code?
This article explains very well where are located extensions code for Firefox, Chrome (working on Chromium too of course) on Ubuntu and Windows!
Best,

Can't deploy extension (firefox)

I am closely following the tutorial here as I attempt to create a Firefox extension. I have the following tree for my extension:
backtosearch
+-chrome
+-content
backtosearch.xul
+-chrome.manifest
+-install.rdf
I have created a testing profile for FF called "Extension Testing" and have added a file to the profile extensions folder "backtosearch#my.name" containing absolute path to the extension folder. I have reloaded the browser chrome using the extension development extension and restarted the browser - but I see no new button.
I have simplified the tutorial (as I only require one button), and my .xul contains only that. My chrome.manifest file contains:
content backtosearch chrome/content/
overlay chrome://browser/content/browser.xul chrome://backtosearch/content/backtosearch.xul
The extension is not showing under view -> toolbars or tools -> addons
Thanks for any help
install.rdf
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<!-- Required Items -->
<em:id>backtosearch#dylan.lloyd</em:id>
<em:name>Back To Search</em:name>
<em:version>1.0</em:version>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>3.5.*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Optional Items -->
<em:creator>Dylan Lloyd</em:creator>
<em:description>Adds options to return to your last search immediately.</em:description>
<em:homepageURL>http://www.getyourkeywords.com/</em:homepageURL>
</Description>
</RDF>
backtosearch#dylan.lloyd
C:\Users\Dylan\Desktop\backtosearch\
Hey I found out in moziila own documentation the mistake on this hello world.
You can read on:
https://github.com/oschrenk/firefox-extension
I had written
<RDF xmlns="http://www.w3.org/1999/02/22-RDF-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-RDF#">
<Description about="urn:mozilla:install-manifest">
as the root element, but it needs to be all lowercase
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
Just update the install.rdf =)
From your description it's not clear what the problem is. The most likely cause, as sdwilsh noted is that the Extension didn't get registered. If this is the case, the extension will not appear in Tools -> Addons.
You can try to set extensions.logging.enable pref to true to help debugging. Maybe try installing a helloworld extension first?
Possible causes:
You didn't use the correct name for the "link" file (must match the extension ID).
The "link" file contents is invalid (the path format is OS-native). In your case the path should end with "backtosearch"
Incorrect install.rdf. You can check it at least to be valid XML by opening it in Firefox (possibly renaming to .xml first) -- if the yellow screen opens, its invalid.
Installed in the wrong profile or didn't really restart Firefox.
If the extension is registered, try opening chrome://backtosearch/content/backtosearch.xul in Firefox (by copying that to the Location bar) -- if any errors appear, you should fix them. If the file loads successfully (may be empty), there's a problem with your overlay's contents, which is hard to debug without seeing it. Perhaps start with an overlay that's known to work?
Try running it through Mozilla's Add-On Validation page. It might just tell you what the error is. If it is a javascript error, it will tell you for sure.
Now, I had the same problem - when I loaded my addon, my toolbar didn't appear, and even though the addon showed in "Tools > Addons", when I clicked on the "options" button, everything froze.
Turned out, there were several errors.
The optionsurl in my install.rdf had "cchrome" instead of "chrome".
In my main .js file, I forgot a ";" at the end of a line with a var
assignment.
In my xul file, I did not leave a space: label="string"tooltip="string" between the two property assignments.
I had a hanging </toolbarbutton> from where I copied one line to the next. This is what really caused the problem. In the code file, the line was very long, and I never saw that part!
The combination was total failure, even though it passed fine in the Mozilla Validator.
The Validator, in my opinion should have caught the cchrome thing. It would have caught the javascript error.
Anyway, I tell you that in case such might be YOUR problem.

Can I use CSS in directory listing of Firefox?

For example if I put "C:\docs" in address bar of Firefox, it shows all files in the directory. Is it possible to customize this page with CSS?
Apache 2.2 allows us to do it using IndexStyleSheet directive, so I wondered if Firefox can do it.
Firefox has a file userContent.css for each profile (found in the profile's settings folder). That file defines the standard CSS, why may then be overwritten by a website. So they also apply to directory listings.
You should have a look at the actual HTML code Firefox is creating for the directory listing to see how to do the CSS definitions right. You will find extensive documentation about userContent.css on the web.
http://www.mozilla.org/unix/customizing.html#userContent
I think the easiest way is to create an own skin which custom css. You have to modify dirListing.css in this case. (chrome://global/skin/dirListing/dirListing.css)
I know the walnut theme (https://addons.mozilla.org/en-US/firefox/addon/122) includes a modified file listing.

Resources