Fixes for extensions broken since new addon manager landed

Discussion about official Mozilla Firefox builds
Locked
d.a.
Posts: 142
Joined: June 17th, 2008, 2:41 pm

Fixes for extensions broken since new addon manager landed

Post by d.a. »

A thread containing fixes to extensions broken by the landing of the new addon manager, apply these modifications if you want to use the latest nightly releases and still be able to use your extensions. If you do not want to mess with these extensions you either have to go back to the 4/29 build or live with the broken extensions until they've been properly updated by their authors.

This fixes Greasemonkey:

In file extensions/{e4a8a97b-f2ed-450b-b12d-ee082ba24781}/content/config.js, around line 410 (search for "@mozilla.org/extensions/manager"), and replace the 4 lines (should be the same as the first 4 lines here only it's been commented) with the stuff below:

Code: Select all

        /*var extMan = Components.classes["@mozilla.org/extensions/manager;1"]
          .getService(Components.interfaces.nsIExtensionManager);
        var item = extMan.getItemForID(GM_GUID);
        GM_prefRoot.setValue("version", item.version);*/
        Components.utils.import("resource://gre/modules/AddonManager.jsm");

        AddonManager.getAddonByID("{e4a8a97b-f2ed-450b-b12d-ee082ba24781}", function(addon) {
           GM_prefRoot.setValue("version", addon.version)
        });


This fixes ForecastFox, a little trickier since it uses a jar-file:

Look for extensions/{0538E3E3-7E9B-4d49-8831-A227C80A7AD3}/chrome/forecastfox.jar

Here you have two options, either edit a file from within the .jar file (may not always work properly) or extract it (it's a normal zip file so just change the extension of it to .zip instead of .jar).

The file that needs to be changed is content/ping/ping-service.js. look for var exMgr (should be on line 88). On the beginning of that line add "//" (without the ") and on the following row do the same. Should look like this:

Code: Select all

    //   var exMgr = Cc["@mozilla.org/extensions/manager;1"].
       //             getService(Ci.nsIExtensionManager);


If you unpacked the .jar you need to do one more thing:

Open up chrome.manifest directly in the "{0538E3E3-7E9B-4d49-8831-A227C80A7AD3}" folder, in here you need to replace all "jar:chrome/forecastfox.jar!" with "chrome/forecastfox". "forecastfox" refers to the folder that was created when you unpacked the jar-file. By default it usually is the name of the archive. Check in the chrome folder to see what your name is.

This fixes DownThemAll:
http://bugs.code.downthemall.net/trac/changeset/1877

Before you apply the fix for DownThemAll you need to unpack the jar-file for DownThemAll, the extension-folder for it is: "{DDC359D1-844A-42a7-9AA1-88A850A938A8}".

You also need to modify the chrome.manifest to remove the reference to the jar file like described above for ForecastFox.
Last edited by LoudNoise on March 22nd, 2011, 9:23 am, edited 2 times in total.
Reason: needed again.
User avatar
WildcatRay
Posts: 7484
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Re: Fixes for extensions broken since 20100430 trunk

Post by WildcatRay »

Depending on what archiving program you use, it may properly recognize .jar files as archives that can be unzipped. I have used both 7zip and PowerArchiver when "hacking" an add-on. Others have reported that they have used others like Winrar and Winzip, too.

Something to be aware of is that some .jar files are compressed--zipped--while others are not. When using PowerArchiver, I would choose "compress with options" and then check the "Compression" option. If the original .jar was compressed it was most likely "Normal" compression. If it was not compressed, the PowerArchiver compression option would be "None".

When you go to compress the .jar file, if using most archiving programs unless otherwise specified, it will save as .zip file. Compare the size of the original .jar and the .zip you just created. If they match, then you have compressed the file using the proper compression. If not you will have to redo the zipping setting the compression to the proper option to match what the author did.

When you compress the add-on, you should check that your "hacked" version is the same size as the original. If it isn't, then you will need to redo the zipping with the proper compression option.

I hope I have not confused the heck out of anybody. [-o<
Ray

OS'es: 4 computers with Win10 Pro 64-bit; Current Firefox, Beta, Nightly, Chrome, Vivaldi
GTK66
Posts: 1896
Joined: May 30th, 2004, 5:20 am

Re: Fixes for extensions broken since 20100430 trunk

Post by GTK66 »

Thanks fot the info!
User avatar
BigWillyStyle42
Posts: 694
Joined: June 20th, 2006, 4:57 pm
Contact:

Re: Fixes for extensions broken since 20100430 trunk

Post by BigWillyStyle42 »

WildcatRay wrote:Something to be aware of is that some .jar files are compressed--zipped--while others are not. When using PowerArchiver, I would choose "compress with options" and then check the "Compression" option. If the original .jar was compressed it was most likely "Normal" compression. If it was not compressed, the PowerArchiver compression option would be "None".

When you go to compress the .jar file, if using most archiving programs unless otherwise specified, it will save as .zip file. Compare the size of the original .jar and the .zip you just created. If they match, then you have compressed the file using the proper compression. If not you will have to redo the zipping setting the compression to the proper option to match what the author did.

When you compress the add-on, you should check that your "hacked" version is the same size as the original. If it isn't, then you will need to redo the zipping with the proper compression option.


I don't see why the compression is relevant.
Harald.L
Posts: 280
Joined: October 22nd, 2004, 12:36 am
Location: Bavaria/Germany

Re: Fixes for extensions broken since 20100430 trunk

Post by Harald.L »

BigWillyStyle42 wrote:I don't see why the compression is relevant.

Extensions are not decompressed when installed. Every access to a component has to uncompress it from the jar file. Compression only saves a little space (not really important) but slows the use of the extension as the continuous decompress actions eat much more cpu power. So a "flat" packing without a real compression is best.
My primary ffox test system: http://www.sysprofile.de/id20064 (Direct2D: enabled, DirectWrite: enabled, WebGL: ANGLE, GPU Accelerated Windows: Direct3D 10)
Even if my user agent shows Firefox Release version number I'm always using Aurora (updated daily) cloaked by UserAgentSwitcher
User avatar
_Dexter_
Posts: 1436
Joined: August 30th, 2008, 6:54 pm
Location: Miami

Stylish Fix

Post by _Dexter_ »

I changed a few files in the Stylish Content folder that will make your styles visisble again. The only option you have is to Edit the style. No disable, enable, update buttons. The price you pay for a hack job. :D Replace the Stylish files with my files. Your Stylish should be version 1.0.8.

Here's the link:

http://depositfiles.com/files/n5f5xcrxy
Intel i7 Core Quad @ 4.25Ghz | Cooler Master Hyper 212 Plus | 12GB PC3-16000 RAM | ASUS HD6970 2GB - 12.3 CATS | ASUS PA246Q IPS 24" LCD 16:10 | OCZ AGILITY-EX SSD SLC | Windows 7 SP1 x64 Ultimate
User avatar
WildcatRay
Posts: 7484
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Re: Fixes for extensions broken since 20100430 trunk

Post by WildcatRay »

Harald.L wrote:
BigWillyStyle42 wrote:I don't see why the compression is relevant.

Extensions are not decompressed when installed. Every access to a component has to uncompress it from the jar file. Compression only saves a little space (not really important) but slows the use of the extension as the continuous decompress actions eat much more cpu power. So a "flat" packing without a real compression is best.

I cannot speak to what Harald says. My experience was a few weeks back when a simple tweak to Tab Mix Plus was needed to get it working in Trunk at the time. It turns out that onemen does not compress (zip) the internal tabmixplus.jar file. Without realizing it, I assumed it was compressed, zipped it up, zipped up the xpi and tried to install it. Big, fracked up mess. ](*,) Once I was informed that the jar file was not compressed, I was able to successfully hack the add-on and it installed properly.

That experience is why I posted about it here. My hope is to help others learn from my experience back then.
Ray

OS'es: 4 computers with Win10 Pro 64-bit; Current Firefox, Beta, Nightly, Chrome, Vivaldi
User avatar
BigWillyStyle42
Posts: 694
Joined: June 20th, 2006, 4:57 pm
Contact:

Re: Fixes for extensions broken since 20100430 trunk

Post by BigWillyStyle42 »

Harald.L wrote:
BigWillyStyle42 wrote:I don't see why the compression is relevant.

Extensions are not decompressed when installed. Every access to a component has to uncompress it from the jar file. Compression only saves a little space (not really important) but slows the use of the extension as the continuous decompress actions eat much more cpu power. So a "flat" packing without a real compression is best.

Right so I would have expected the best choice would be to always leave the jar file uncompressed, regardless of what the original author did.

WildcatRay wrote:I cannot speak to what Harald says. My experience was a few weeks back when a simple tweak to Tab Mix Plus was needed to get it working in Trunk at the time. It turns out that onemen does not compress (zip) the internal tabmixplus.jar file. Without realizing it, I assumed it was compressed, zipped it up, zipped up the xpi and tried to install it. Big, fracked up mess. ](*,) Once I was informed that the jar file was not compressed, I was able to successfully hack the add-on and it installed properly.

I just wouldn't have expected that to fail :) thanks for the info.
User avatar
WildcatRay
Posts: 7484
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Re: Fixes for extensions broken since 20100430 trunk

Post by WildcatRay »

I'm not positive, but I think I have seen some add-ons where an internal jar file IS compressed. Guess we need to be observant and react accordingly. [-o<
Ray

OS'es: 4 computers with Win10 Pro 64-bit; Current Firefox, Beta, Nightly, Chrome, Vivaldi
Romani
Posts: 115
Joined: September 4th, 2009, 8:01 am

Re: Fixes for extensions broken since 20100430 trunk

Post by Romani »

New version of WOT can be obtained here http://www.mywot.com/ru/forum/6274-new- ... lly-broken
User avatar
WildcatRay
Posts: 7484
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Re: Fixes for extensions broken since new addon manager landed

Post by WildcatRay »

d.a. wrote:This fixes Greasemonkey:

In file extensions/{e4a8a97b-f2ed-450b-b12d-ee082ba24781}/content/config.js, around line 410 (search for "@mozilla.org/extensions/manager"), and replace the 4 lines (should be the same as the first 4 lines here only it's been commented) with the stuff below:

Code: Select all

        /*var extMan = Components.classes["@mozilla.org/extensions/manager;1"]
          .getService(Components.interfaces.nsIExtensionManager);
        var item = extMan.getItemForID(GM_GUID);
        GM_prefRoot.setValue("version", item.version);*/
        Components.utils.import("resource://gre/modules/AddonManager.jsm");

        AddonManager.getAddonByID("{e4a8a97b-f2ed-450b-b12d-ee082ba24781}", function(addon) {
           GM_prefRoot.setValue("version", addon.version)
        });


Worked like a charm, d.a.

For others who may not be sure, you will replace these lines of code in the file config.js between lines 414 & 417:

Code: Select all

        var extMan = Components.classes["@mozilla.org/extensions/manager;1"]
          .getService(Components.interfaces.nsIExtensionManager);
        var item = extMan.getItemForID(GM_GUID);
        GM_prefRoot.setValue("version", item.version);

with those in his post above.

Also, if you are editing the xpi file, it is not compressed so you will have to verify that you are not compressing it when you zip it up.
Ray

OS'es: 4 computers with Win10 Pro 64-bit; Current Firefox, Beta, Nightly, Chrome, Vivaldi
GTK66
Posts: 1896
Joined: May 30th, 2004, 5:20 am

Re: Fixes for extensions broken since new addon manager landed

Post by GTK66 »

I have manually added a few scripts but until this is released as Firefox 4.0, I am staying away from extensions that are not compatible.
User avatar
ltsnow
Posts: 1173
Joined: March 23rd, 2006, 1:49 pm
Location: Valdosta, GA

Re: Fixes for extensions broken since new addon manager landed

Post by ltsnow »

Anybody know how to fix Stylish 1.0.8? It installs fine and when importing the two Stylish files from Firefox 3.6.4 (rdf and sqlite) it works fine, but you can't see your individual scripts.
User avatar
WildcatRay
Posts: 7484
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Re: Fixes for extensions broken since new addon manager landed

Post by WildcatRay »

I do not recall seeing anything for Stylish. However, you can put your styles in your profile's chrome folder. Styles for content/web sites or pages go into userContent.css. Styles for the browser go into userChrome.css. The browser will need to be (re)started after the files have been completed, though.
Ray

OS'es: 4 computers with Win10 Pro 64-bit; Current Firefox, Beta, Nightly, Chrome, Vivaldi
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Fixes for extensions broken since new addon manager landed

Post by trolly »

Is there an error message for stylish?
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
Locked