How to create hidden Firefox Extension?

2019-04-16 10:46发布

问题:

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

回答1:

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.



回答2:

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.