[Signed fixed extension attached] CB broken on Firefox 48+

Post information about bugs here

Re: [Signed fixed extension attached] CB broken on Firefox 4

Postby trapper john » Sun Jan 28, 2018 2:38 am

morat wrote:I didn't test the idea... instead of using Dumby's fix, why can't we take the defaults\preferences\*.js files in the *.xpi files and place these *.js files into the folder with the autoconfig.js file?

Thanks for this tip, wish I knew earlier, it works good, got a few of my legacy addons back (Menu Editor and Context Bookmarks). Now we don't have to bug Dumby. :--)

Shame about userChrome.css, that's the only lifeline we have to customization but I'm trying to hang on to 60esr.
trapper john
 
Posts: 120
Joined: Wed Mar 14, 2012 6:58 pm

Re: [Signed fixed extension attached] CB broken on Firefox 4

Postby trapper john » Sun Jan 28, 2018 3:10 am

morat, could you check please if this page styles code works for 58:

var viewStyle = getMarkupDocumentViewer().authorStyleDisabled;
if (viewStyle) {
getMarkupDocumentViewer().authorStyleDisabled = false;
} else {
getMarkupDocumentViewer().authorStyleDisabled = true;
}

It broke for me sometime in 58 or 59.
trapper john
 
Posts: 120
Joined: Wed Mar 14, 2012 6:58 pm

Re: [Signed fixed extension attached] CB broken on Firefox 4

Postby morat » Sun Jan 28, 2018 9:06 am

Try this:

Code: Select all
/*Code*/
var browser = gBrowser.selectedBrowser;
var styleSheetInfo = gPageStyleMenu._getStyleSheetInfo(browser);
var styleDisabled = styleSheetInfo.authorStyleDisabled;
if (styleDisabled) {
  gPageStyleMenu.switchStyleSheet("");
} else {
  gPageStyleMenu.disableStyle();
}

view-source:chrome://browser/content/browser.xul
view-source:chrome://browser/content/browser.js
morat
 
Posts: 959
Joined: Wed Dec 28, 2011 2:38 pm

Re: [Signed fixed extension attached] CB broken on Firefox 4

Postby trapper john » Sun Jan 28, 2018 1:44 pm

That works good, thank-you. Can't live without this one, it gets rid of the junk quickly so you can easily read the page.
trapper john
 
Posts: 120
Joined: Wed Mar 14, 2012 6:58 pm

Re: [Signed fixed extension attached] CB broken on Firefox 4

Postby Infocatcher » Mon Mar 19, 2018 11:28 am

Yet another fixes up to Firefox 61.0a1 (2018-03-18)
Also still thanks to Dumby.

Not signed: custom_buttons-0.0.5.8.9-fixed8.xpi
Signed: custom_buttons-0.0.5.8.9-fixed8-signed.xpi

In about:config, to install:
extensions.allow-non-mpc-extensions = true
extensions.legacy.enabled = true
Tricks for unsigned versions:
https://forum.mozilla-russia.org/viewtopic.php?id=70326
To force enable e10s mode:
browser.tabs.remote.force-enable = true
Attachments
custom_buttons-0.0.5.8.9-fixed8.xpi.zip
Unsigned version
(117.76 KiB) Downloaded 17 times
custom_buttons-0.0.5.8.9-fixed8-signed.xpi.zip
Signed version
(127.94 KiB) Downloaded 32 times
Infocatcher
 
Posts: 124
Joined: Sat Jul 21, 2012 5:04 pm

Re: [Signed fixed extension attached] CB broken on Firefox 4

Postby trapper john » Sun Mar 25, 2018 1:46 am

Dumby comes through again. If it wasn't for custom buttons I most likely wouldn't even bother with nightlies.

It does look like this addon will make it through to 60esr but does anyone know if it is possible to enable legacy addons in the release? For 60 beta they are still working and if they break there are unbranded builds:

https://wiki.mozilla.org/Add-ons/Extens ... ded_Builds

In the official 59 release however they are disabled and that earlier hack is gone. I deoptimized omni.ja using the python script but then it wouldn't optimize it again so even if the old hack were still there the optimize method would also have to be done differently. The reason I'm trying to figure this out is because there might not be unbranded esr versions so it would be nice to again find a way to restore legacy addons in the official release.
trapper john
 
Posts: 120
Joined: Wed Mar 14, 2012 6:58 pm

Re: [Signed fixed extension attached] CB broken on Firefox 4

Postby morat » Sun Mar 25, 2018 3:22 am

Many thanks to Dumby and Infocatcher.

@trapper john

Here is how to install legacy extensions without hacking the omni.ja file. It works in Firefox 58 release build. It's still working in Firefox 59 release build.

* <installation directory>\defaults\pref\autoconfig.js ( e.g. C:\FirefoxPortable\App\Firefox\defaults\pref\autoconfig.js )

Code: Select all
// autoconfig.js file needs to start with a comment line

pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0);

* <installation directory>\mozilla.cfg ( e.g. C:\FirefoxPortable\App\Firefox\mozilla.cfg )

Code: Select all
// mozilla.cfg file needs to start with a comment line

// Disable Signing Requirement
// Enable Legacy Extensions
// Enable Non Multiprocess Compatible Extensions

pref("xpinstall.signatures.required", false);
pref("extensions.legacy.enabled", true);
pref("extensions.allow-non-mpc-extensions", true);

var scope = Components.utils.import("resource://gre/modules/AppConstants.jsm");
scope.AppConstants = Object.assign({}, AppConstants, {
  MOZ_REQUIRE_SIGNING: false,
  MOZ_ALLOW_LEGACY_EXTENSIONS: true,
});

I got the following Custom Buttons working in Firefox 58 release build. It's still working in Firefox 59 release build.

custom_buttons-0.0.5.8.9-fixed7pre.xpi
viewtopic.php?p=77941#p77941

I got DOM Inspector Plus 2.0.17.1.2rc and Attributes Inspector working in Firefox 58 release build. However, it's broken in Firefox 59 release build.

DOM Inspector Plus
http://addons.mozilla.org/firefox/addon/254571

Also,

When Custom Buttons breaks, I will use the CustomizableUI to create buttons.

Firefox Quantum compatible userChrome.js
http://github.com/Sporif/firefox-quantum-userchromejs

Restart Button
http://gist.github.com/Sporif/ad6e917d8 ... 80d3c8918c

* OpenPageInfoFirefoxButton_Movable.uc.js

Code: Select all
(function () {
  if (location != "chrome://browser/content/browser.xul") return;

  /* CustomizableUI
     http://developer.mozilla.org/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm
  */

  try {
    CustomizableUI.createWidget({
      id: "open-page-info-button", // should match id below
      type: "custom",
      defaultArea: CustomizableUI.AREA_MENUBAR,
   // defaultArea: CustomizableUI.AREA_NAVBAR,
      onBuild: function (aDocument) {
        var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
        var toolbaritem = aDocument.createElementNS(XUL_NS, "toolbarbutton");
        toolbaritem.onclick = event => onClick(event);
        var props = {
          id: "open-page-info-button",
          class: "toolbarbutton-1 chromeclass-toolbar-additional",
          label: "Open Page Info",
          tooltiptext: "Open page info window for current page",
          style: 'list-style-image: url("chrome://branding/content/icon16.png");',
        };
        for (var p in props) toolbaritem.setAttribute(p, props[p]);
        return toolbaritem;
      },
    });
  } catch (e) {};

  function onClick(event) {
    if (event.button == 0) {
      Services.console.logStringMessage("test open page info button");
      BrowserPageInfo();
    }
  }
})();

CustomizableUI
http://developer.mozilla.org/en-US/docs ... ableUI.jsm
morat
 
Posts: 959
Joined: Wed Dec 28, 2011 2:38 pm

Re: [Signed fixed extension attached] CB broken on Firefox 4

Postby trapper john » Sun Mar 25, 2018 3:57 am

That works great morat, thank-you. It's a lot easier than hacking it each time. That method has kept several of my old addons going for now like context bookmarks that I've been using since Firefox 3.

Thanks also for that link to CustomizableUI, I'll take a look at that as soon as I get a chance.
trapper john
 
Posts: 120
Joined: Wed Mar 14, 2012 6:58 pm

Re: [Signed fixed extension attached] CB broken on Firefox 4

Postby trapper john » Mon Mar 26, 2018 4:55 am

morat, that trick above seemed to work for 59, although I didn't run it for long but today all my legacy addons in 60 beta6 disabled. I'm now running an unbranded build. I'm going to try and make the change directly in modules/AppConstants but optimizing with the python script is a problem so I'll have to try something else.
trapper john
 
Posts: 120
Joined: Wed Mar 14, 2012 6:58 pm

Re: [Signed fixed extension attached] CB broken on Firefox 4

Postby morat » Mon Mar 26, 2018 4:57 pm

The mozilla.cfg hack fails in Firefox 60 beta build. I can't change the AppConstants object in Fx 60, like I could in Fx 59. I don't know a solution.

I tried...

Code: Select all
// mozilla.cfg file needs to start with a comment line

Components.utils.import("resource://gre/modules/Services.jsm");

Services.console.logStringMessage("test mozilla.cfg");
Services.console.logStringMessage(typeof(ChromeUtils)); // undefined

// Disable Signing Requirement
// Enable Legacy Extensions
// Enable Non Multiprocess Compatible Extensions

pref("xpinstall.signatures.required", false);
pref("extensions.legacy.enabled", true);
pref("extensions.allow-non-mpc-extensions", true);

var scope = Components.utils.import("resource://gre/modules/AppConstants.jsm");
scope.AppConstants = Object.assign({}, AppConstants, {
  MOZ_REQUIRE_SIGNING: false,
  MOZ_ALLOW_LEGACY_EXTENSIONS: true,
});

Components.utils.importGlobalProperties(["ChromeUtils"]);
var scope = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
scope.AppConstants = Object.assign({}, AppConstants, {
  MOZ_REQUIRE_SIGNING: false,
  MOZ_ALLOW_LEGACY_EXTENSIONS: true,
});

Code: Select all
// test in browser console and web console with about:addons page

var scopeA = Components.utils.import("resource://gre/modules/AppConstants.jsm");
var scopeB = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
console.log("1: " +        AppConstants.MOZ_REQUIRE_SIGNING);
console.log("2: " +        AppConstants.MOZ_ALLOW_LEGACY_EXTENSIONS);
console.log("1: " + scopeA.AppConstants.MOZ_REQUIRE_SIGNING);
console.log("2: " + scopeA.AppConstants.MOZ_ALLOW_LEGACY_EXTENSIONS);
console.log("1: " + scopeB.AppConstants.MOZ_REQUIRE_SIGNING);
console.log("2: " + scopeB.AppConstants.MOZ_ALLOW_LEGACY_EXTENSIONS);

Reference
http://dxr.mozilla.org/mozilla-beta/source/toolkit/mozapps/extensions/internal/AddonSettings.jsm
http://dxr.mozilla.org/mozilla-release/source/toolkit/mozapps/extensions/internal/AddonSettings.jsm
http://dxr.mozilla.org/mozilla-beta/source/toolkit/modules/AppConstants.jsm
http://dxr.mozilla.org/mozilla-release/source/toolkit/modules/AppConstants.jsm
http://dxr.mozilla.org/mozilla-beta/source/toolkit/mozapps/extensions/content/extensions.js
http://dxr.mozilla.org/mozilla-release/source/toolkit/mozapps/extensions/content/extensions.js
http://dxr.mozilla.org/mozilla-beta/source/browser/config/version.txt
http://dxr.mozilla.org/mozilla-release/source/browser/config/version.txt
morat
 
Posts: 959
Joined: Wed Dec 28, 2011 2:38 pm

PreviousNext

Return to Bug report

cron