Closed onemen closed 2 years ago
@xiaoxiaoflood ,
This change fix this issue, can you test it.
config.js
// skip 1st line
lockPref('xpinstall.signatures.required', false);
Object = Cu.getGlobalForObject(Cu).Object;
const { freeze } = Object;
Object.freeze = obj => {
if (Components.stack.caller.filename != 'resource://gre/modules/AppConstants.jsm')
return freeze(obj);
obj.MOZ_REQUIRE_SIGNING = false;
Object.freeze = freeze;
return freeze(obj);
}
try {
const { Services } = Cu.import('resource://gre/modules/Services.jsm');
- Cu.import(Services.io.newFileURI(Services.dirsvc.get('ProfD', Ci.nsIFile)).spec + 'chrome/utils/boot.jsm');
+ const url = Services.io.newFileURI(Services.dirsvc.get('ProfD', Ci.nsIFile)).spec + 'chrome/utils/boot.jsm';
+ Services.scriptloader.loadSubScript(url, {});
} catch (ex) { };
boot.jsm
let EXPORTED_SYMBOLS = [];
let cmanifest = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('UChrm', Ci.nsIFile);
cmanifest.append('utils');
cmanifest.append('chrome.manifest');
Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);
- ChromeUtils.import('chrome://userchromejs/content/BootstrapLoader.jsm');
+ Cu.import('chrome://userchromejs/content/BootstrapLoader.jsm');
- ChromeUtils.import('chrome://userchromejs/content/userChrome.jsm');
+ Cu.import('chrome://userchromejs/content/userChrome.jsm');
Better option
config.js
// skip 1st line
lockPref('xpinstall.signatures.required', false);
Object = Cu.getGlobalForObject(Cu).Object;
const { freeze } = Object;
Object.freeze = obj => {
if (Components.stack.caller.filename != 'resource://gre/modules/AppConstants.jsm')
return freeze(obj);
obj.MOZ_REQUIRE_SIGNING = false;
Object.freeze = freeze;
return freeze(obj);
}
try {
- const { Services } = Cu.import('resource://gre/modules/Services.jsm');
- Cu.import(Services.io.newFileURI(Services.dirsvc.get('ProfD', Ci.nsIFile)).spec + 'chrome/utils/boot.jsm');
+ let cmanifest = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('UChrm', Ci.nsIFile);
+ cmanifest.append('utils');
+ cmanifest.append('chrome.manifest');
+ Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);
+ Cu.import('chrome://userchromejs/content/boot.jsm');
} catch (ex) { };
boot.jsm
let EXPORTED_SYMBOLS = [];
- let cmanifest = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('UChrm', Ci.nsIFile);
- cmanifest.append('utils');
- cmanifest.append('chrome.manifest');
- Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);
ChromeUtils.import('chrome://userchromejs/content/BootstrapLoader.jsm');
ChromeUtils.import('chrome://userchromejs/content/userChrome.jsm');
Thanks.
config.js stop working on Firefox Nightly 101.0a1 build 20220407092959
the line above throw the error:
Uncaught DOMException: Component returned failure code: 0x80530012 [nsIXPCComponents_Utils.import]
this error code is for
DOMException: The operation is insecure