Hello, everybody.
Like the title says, Custom Buttons add-on is broken on all Firefox versions higher than 48.
Error number one
Some button properties defined by the add-on, like this.Help, are undefined. And some global properties, like window.name, throws errors (TypeError: this.hasAttribute is not a function). It seems that it has something to do with bug 943958, but I'm not sure.
I fixed this by simply editing the file cbbuttonimpl.js. I changed all instances of __defineGetter__ and __defineSetter__ to this.__defineGetter__ and this.__defineSetter__. I don't know if this is the right way to fix this. Like always, that's for the experts to decide.
Error number two
The console is broken again. Instead of opening the edit window of the button with the line highlighted, it tries to directly open the chrome://custombuttons-context/content/button.js file. This has happened several times before in other CB breakages, but this time I don't know how to fix it.
Error number three
This is more an annoyance than an error. Since the changes on Custom Buttons add-on to fix the newChannel deprecation on the nsIIOService service, every time a button is edited and/or initialized, the console is poluted with warnings like this:
- Code: Select all
Warning: 'nsIOService::NewChannel()' deprecated, please use 'nsIOService::NewChannel2()'
Inverting the condition in the getChannel method inside the CustomButtonsService.js file seems to get rid of that annoying warning.
- Code: Select all
getChannel: function (aSpec, aContentPolicy) {
var ios = Components. classes ["@mozilla.org/network/io-service;1"]. getService (Components. interfaces.nsIIOService);
var chan;
var contentPolicy = aContentPolicy || Components. interfaces. nsIContentPolicy. TYPE_OTHER;
if ("newChannel2" in ios)
chan = ios. newChannel2 (
aSpec,
null,
null,
null,
Components. classes ["@mozilla.org/systemprincipal;1"]. createInstance (Components. interfaces.nsIPrincipal),
null,
Components. interfaces. nsILoadInfo. SEC_NORMAL,
contentPolicy);
else
chan = ios. newChannel (aSpec, null, null);
return chan;
}
The following two attached extensions are packaged by InfoCatcher and are the same files added by him on several messages in this very topic. Both attached extensions are exactly the same. One is signed and the other isn't. Install the one you need to.
Fixes by InfoCatcher and Dumby
- Fixed the errors reported on this topic.
- Fixed the error reported in this other topic (DOMParser breakage).
- Fixed base64 converter and opening editor from console in Firefox 55+ (due to nsISupportsArray removal).
Remove the ".zip" extension from the file name to be able to install the attached extension.
Also uninstall or disable any other version of Custom Buttons add-on from your browser.