|
1 |
| -const EXPORTED_SYMBOLS = []; |
2 |
| - |
3 |
| -const { XPCOMUtils } = ChromeUtils.import('resource://gre/modules/XPCOMUtils.jsm'); |
4 |
| -const Services = globalThis.Services || ChromeUtils.import('resource://gre/modules/Services.jsm').Services; |
5 |
| -ChromeUtils.defineLazyGetter(this, 'gSystemPrincipal', () => Services.scriptSecurityManager.getSystemPrincipal()); |
6 |
| -XPCOMUtils.defineLazyModuleGetters(this, { |
7 |
| - AppConstants: 'resource://gre/modules/AppConstants.jsm', |
8 |
| - BrowserWindowTracker: 'resource:///modules/BrowserWindowTracker.jsm', |
9 |
| - NetUtil: 'resource://gre/modules/NetUtil.jsm', |
10 |
| - LangPackMatcher: 'resource://gre/modules/LangPackMatcher.jsm', |
11 |
| - applySystemIntegration: 'resource://pwa/utils/systemIntegration.jsm', |
12 |
| -}); |
| 1 | +import { AppConstants } from 'resource://gre/modules/AppConstants.sys.mjs'; |
| 2 | +import { NetUtil } from 'resource://gre/modules/NetUtil.sys.mjs'; |
| 3 | +import { nsDefaultCommandLineHandler, nsBrowserContentHandler } from 'resource:///modules/BrowserContentHandler.sys.mjs'; |
| 4 | +import { BrowserWindowTracker } from 'resource:///modules/BrowserWindowTracker.sys.mjs'; |
| 5 | + |
| 6 | +import { applySystemIntegration } from 'resource://pwa/utils/systemIntegration.sys.mjs'; |
13 | 7 |
|
14 | 8 | /**
|
15 | 9 | * Reads the PWAsForFirefox config file and parses it as JSON.
|
@@ -126,7 +120,6 @@ Services.prefs.getDefaultBranch(null).setBoolPref('browser.privateWindowSeparati
|
126 | 120 | Services.prefs.getDefaultBranch(null).setBoolPref('browser.privacySegmentation.createdShortcut', true);
|
127 | 121 |
|
128 | 122 | // Override command line helper to intercept PWAsForFirefox arguments and start loading the site
|
129 |
| -const { nsDefaultCommandLineHandler } = Cu.import('resource:///modules/BrowserContentHandler.jsm'); |
130 | 123 | nsDefaultCommandLineHandler.prototype._handle = nsDefaultCommandLineHandler.prototype.handle;
|
131 | 124 | nsDefaultCommandLineHandler.prototype.handle = function (cmdLine) {
|
132 | 125 | const isStartup = cmdLine.state === Ci.nsICommandLine.STATE_INITIAL_LAUNCH;
|
@@ -183,7 +176,6 @@ nsDefaultCommandLineHandler.prototype.handle = function (cmdLine) {
|
183 | 176 | // Still does not work when multiple web apps are used in the same profile
|
184 | 177 | // This does not matter currently because of #81, but once it is fixed, this also needs to be reworked
|
185 | 178 | if (AppConstants.platform === 'macosx') {
|
186 |
| - const { nsBrowserContentHandler } = Cu.import('resource:///modules/BrowserContentHandler.jsm'); |
187 | 179 | nsBrowserContentHandler.prototype._getNewWindowArgs = nsBrowserContentHandler.prototype.getNewWindowArgs;
|
188 | 180 | nsBrowserContentHandler.prototype.getNewWindowArgs = function () {
|
189 | 181 | if (globalThis.gFFPWASiteConfig) {
|
@@ -220,4 +212,4 @@ Services.obs.addObserver(async subject => {
|
220 | 212 | }, 'webextension-langpack-startup');
|
221 | 213 |
|
222 | 214 | // Import browser chrome modifications
|
223 |
| -ChromeUtils.import('resource://pwa/chrome.jsm'); |
| 215 | +ChromeUtils.importESModule('resource://pwa/chrome.sys.mjs'); |
0 commit comments