momo2000
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору // Для установки WebExtensions Experiments необходимо включить их поддержку и отключить проверку цифровых подписей в Firefox try {(nsvo => { var g = Cu.getGlobalForObject(nsvo), o = g.Object, {freeze} = o, NEW; o.freeze = obj => { if (Components.stack.caller.filename != "resource://gre/modules/AppConstants.jsm") return freeze(obj); obj.MOZ_REQUIRE_SIGNING = false; if ((NEW = "MOZ_ALLOW_ADDON_SIDELOAD" in obj)) lockPref("extensions.experiments.enabled", true); else obj.MOZ_ALLOW_LEGACY_EXTENSIONS = true, lockPref("extensions.legacy.enabled", true); return (o.freeze = freeze)(obj); } lockPref("xpinstall.signatures.required", false); lockPref("extensions.langpacks.signatures.required", false); nsvo = Cu.import("resource://gre/modules/addons/XPIInstall.jsm", {}); var shouldVerify = nsvo.shouldVerifySignedState; if (shouldVerify.length == 1) nsvo.shouldVerifySignedState = addon => !addon.id && shouldVerify(addon); else { var {Services} = g.ChromeUtils.import("resource://gre/modules/Services.jsm"); var subst = "pkg-proto-patch-tmp-script"; var rph = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler); var func = async proto => Object.assign(proto, eval( `({${proto.verifySignedState}})`.replace("(!", "(addonId || !") )); var code = encodeURIComponent(`(${func})(Package.prototype);`); rph.setSubstitution(subst, Services.io.newURI("data:," + code)); Services.scriptloader.loadSubScript(`resource://${subst}/`, nsvo); rph.setSubstitution(subst, null); } if (NEW) nsvo.XPIDatabase.isDisabledLegacy = () => false; })( "permitCPOWsInScope" in Cu ? Cu.import("resource://gre/modules/WebRequestCommon.jsm", {}) : Cu );} catch(ex) {Cu.reportError(ex);} // try {({ ids: [ "custombuttons@xsms.org", ], init(xrt) { if (xrt.inSafeMode) return; Cu.import("resource://gre/modules/addons/XPIProvider.jsm", this); var load = async file => { var rootURI = this.XPIInternal.getURIForResourceInFile(file, ""); Cu.import(rootURI.resolve("startup.jsm"), {}).start(rootURI); } var proto = this.XPIInternal.BootstrapScope.prototype; var func = proto._beforeCallBootstrapMethod; proto._beforeCallBootstrapMethod = () => { proto._beforeCallBootstrapMethod = func; for(var addon of this.XPIInternal.XPIStates.enabledAddons()) this.ids.includes(addon.id) && !addon.loader && load(addon.file); } } }).init(Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime));} catch(ex) {Cu.reportError(ex);} |