MozillaZine

Fixes for extensions broken since new addon manager landed

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

Post Posted May 1st, 2010, 4:25 am

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.

WildcatRay

User avatar
 
Posts: 7357
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Post Posted May 1st, 2010, 5:50 am

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 Win10AU (1607) Pro 64-bit; Current Firefox, Beta, Nightly

GTK66
 
Posts: 1896
Joined: May 30th, 2004, 5:20 am

Post Posted May 1st, 2010, 7:13 am

Thanks fot the info!

BigWillyStyle42

User avatar
 
Posts: 686
Joined: June 20th, 2006, 4:57 pm

Post Posted May 1st, 2010, 10:40 am

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

Post Posted May 1st, 2010, 11:48 am

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

_Dexter_

User avatar
 
Posts: 1436
Joined: August 30th, 2008, 6:54 pm
Location: Miami

Post Posted May 1st, 2010, 11:57 am

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

WildcatRay

User avatar
 
Posts: 7357
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Post Posted May 1st, 2010, 12:31 pm

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 Win10AU (1607) Pro 64-bit; Current Firefox, Beta, Nightly

BigWillyStyle42

User avatar
 
Posts: 686
Joined: June 20th, 2006, 4:57 pm

Post Posted May 1st, 2010, 12:39 pm

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.

WildcatRay

User avatar
 
Posts: 7357
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Post Posted May 1st, 2010, 12:51 pm

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 Win10AU (1607) Pro 64-bit; Current Firefox, Beta, Nightly

Romani
 
Posts: 75
Joined: September 4th, 2009, 8:01 am

Post Posted May 2nd, 2010, 6:08 am

New version of WOT can be obtained here http://www.mywot.com/ru/forum/6274-new- ... lly-broken

WildcatRay

User avatar
 
Posts: 7357
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Post Posted May 12th, 2010, 1:24 pm

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 Win10AU (1607) Pro 64-bit; Current Firefox, Beta, Nightly

GTK66
 
Posts: 1896
Joined: May 30th, 2004, 5:20 am

Post Posted May 12th, 2010, 2:53 pm

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.

ltsnow

User avatar
 
Posts: 1101
Joined: March 23rd, 2006, 1:49 pm
Location: Valdosta, GA

Post Posted May 12th, 2010, 3:33 pm

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.

WildcatRay

User avatar
 
Posts: 7357
Joined: October 18th, 2007, 7:03 pm
Location: Columbus, OH

Post Posted May 12th, 2010, 3:55 pm

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 Win10AU (1607) Pro 64-bit; Current Firefox, Beta, Nightly

trolly
Moderator

User avatar
 
Posts: 39827
Joined: August 22nd, 2005, 7:25 am

Post Posted May 12th, 2010, 4:09 pm

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.

Return to Firefox Builds


Who is online

Users browsing this forum: No registered users and 2 guests