mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-06-29 03:21:09 +12:00
This commit is contained in:
parent
e8bcc4ca9f
commit
12a6978748
28
platform/firefox/bootstrap.js
vendored
28
platform/firefox/bootstrap.js
vendored
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
const {classes: Cc, interfaces: Ci} = Components;
|
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||||
|
|
||||||
// Accessing the context of the background page:
|
// Accessing the context of the background page:
|
||||||
// var win = Services.appShell.hiddenDOMWindow.document.querySelector('iframe[src*=umatrix]').contentWindow;
|
// var win = Services.appShell.hiddenDOMWindow.document.querySelector('iframe[src*=umatrix]').contentWindow;
|
||||||
|
@ -38,8 +38,8 @@ let version;
|
||||||
const hostName = 'umatrix';
|
const hostName = 'umatrix';
|
||||||
const restartListener = {
|
const restartListener = {
|
||||||
get messageManager() {
|
get messageManager() {
|
||||||
return Components.classes['@mozilla.org/parentprocessmessagemanager;1']
|
return Cc['@mozilla.org/parentprocessmessagemanager;1']
|
||||||
.getService(Components.interfaces.nsIMessageListenerManager);
|
.getService(Ci.nsIMessageListenerManager);
|
||||||
},
|
},
|
||||||
|
|
||||||
receiveMessage: function() {
|
receiveMessage: function() {
|
||||||
|
@ -89,7 +89,7 @@ function getWindowlessBrowserFrame(appShell) {
|
||||||
windowlessBrowser = appShell.createWindowlessBrowser(true);
|
windowlessBrowser = appShell.createWindowlessBrowser(true);
|
||||||
windowlessBrowser.QueryInterface(Ci.nsIInterfaceRequestor);
|
windowlessBrowser.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||||
let webProgress = windowlessBrowser.getInterface(Ci.nsIWebProgress);
|
let webProgress = windowlessBrowser.getInterface(Ci.nsIWebProgress);
|
||||||
let XPCOMUtils = Components.utils.import('resource://gre/modules/XPCOMUtils.jsm', null).XPCOMUtils;
|
let XPCOMUtils = Cu.import('resource://gre/modules/XPCOMUtils.jsm', null).XPCOMUtils;
|
||||||
windowlessBrowserPL = {
|
windowlessBrowserPL = {
|
||||||
QueryInterface: XPCOMUtils.generateQI([
|
QueryInterface: XPCOMUtils.generateQI([
|
||||||
Ci.nsIWebProgressListener,
|
Ci.nsIWebProgressListener,
|
||||||
|
@ -140,7 +140,8 @@ function waitForHiddenWindow() {
|
||||||
// window for the actual background page (windowless browsers are
|
// window for the actual background page (windowless browsers are
|
||||||
// also what the webextension implementation in Firefox uses for
|
// also what the webextension implementation in Firefox uses for
|
||||||
// background pages).
|
// background pages).
|
||||||
if ( appShell.createWindowlessBrowser ) {
|
let { Services } = Cu.import('resource://gre/modules/Services.jsm', null);
|
||||||
|
if ( Services.vc.compare(Services.appinfo.platformVersion, '27') >= 0 ) {
|
||||||
getWindowlessBrowserFrame(appShell);
|
getWindowlessBrowserFrame(appShell);
|
||||||
} else {
|
} else {
|
||||||
createBgProcess(hiddenDoc);
|
createBgProcess(hiddenDoc);
|
||||||
|
@ -158,8 +159,8 @@ function waitForHiddenWindow() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let ww = Components.classes['@mozilla.org/embedcomp/window-watcher;1']
|
let ww = Cc['@mozilla.org/embedcomp/window-watcher;1']
|
||||||
.getService(Components.interfaces.nsIWindowWatcher);
|
.getService(Ci.nsIWindowWatcher);
|
||||||
|
|
||||||
ww.registerNotification({
|
ww.registerNotification({
|
||||||
observe: function(win, topic) {
|
observe: function(win, topic) {
|
||||||
|
@ -213,9 +214,9 @@ function shutdown(data, reason) {
|
||||||
|
|
||||||
function install() {
|
function install() {
|
||||||
// https://bugzil.la/719376
|
// https://bugzil.la/719376
|
||||||
Components.classes['@mozilla.org/intl/stringbundle;1']
|
Cc['@mozilla.org/intl/stringbundle;1']
|
||||||
.getService(Components.interfaces.nsIStringBundleService)
|
.getService(Ci.nsIStringBundleService)
|
||||||
.flushBundles();
|
.flushBundles();
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@ -226,10 +227,9 @@ function uninstall(data, aReason) {
|
||||||
}
|
}
|
||||||
// To cleanup vAPI.localStorage in vapi-common.js, aka
|
// To cleanup vAPI.localStorage in vapi-common.js, aka
|
||||||
// "extensions.umatrix.*" in `about:config`.
|
// "extensions.umatrix.*" in `about:config`.
|
||||||
Components.utils.import('resource://gre/modules/Services.jsm', null)
|
Cu.import('resource://gre/modules/Services.jsm', null)
|
||||||
.Services.prefs
|
.Services.prefs.getBranch('extensions.' + hostName + '.')
|
||||||
.getBranch('extensions.' + hostName + '.')
|
.deleteBranch('');
|
||||||
.deleteBranch('');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<targetApplication>
|
<targetApplication>
|
||||||
<r:Description>
|
<r:Description>
|
||||||
<id>{{ec8030f7-c20a-464f-9b0e-13a3a9e97384}}</id>
|
<id>{{ec8030f7-c20a-464f-9b0e-13a3a9e97384}}</id>
|
||||||
<minVersion>27.0</minVersion>
|
<minVersion>24.0</minVersion>
|
||||||
<maxVersion>*</maxVersion>
|
<maxVersion>*</maxVersion>
|
||||||
</r:Description>
|
</r:Description>
|
||||||
</targetApplication>
|
</targetApplication>
|
||||||
|
|
Loading…
Reference in a new issue