Skip to content

Commit 31a07ac

Browse files
committed
Update JS loader to work with FF147+
1 parent 8b05bdf commit 31a07ac

File tree

5 files changed

+39
-24
lines changed

5 files changed

+39
-24
lines changed

Installers/Multirow & other functions/root/config.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ try {
77
cmanifest.append('utils');
88
cmanifest.append('chrome.manifest');
99
Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);
10-
11-
Services.scriptloader.loadSubScript('chrome://userchromejs/content/BootstrapLoader.js');
12-
} catch (ex) {}
10+
} catch (e) {
11+
Components.utils.reportError(e);
12+
}
1313

1414
try {
15-
Services.scriptloader.loadSubScript('chrome://userchromejs/content/userChrome.js');
16-
} catch (ex) {}
15+
Services.scriptloader.loadSubScript('chrome://userchromejs/content/userChrome.js');
16+
} catch(e) {
17+
Components.utils.reportError(e);
18+
}

Installers/Multirow & other functions/utils/userChrome.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ let _uc = {
107107
if (!script.regex.test(win.location.href) || (script.filename != this.ALWAYSEXECUTE && !script.isEnabled)) {
108108
return;
109109
}
110-
111110
if (script.onlyonce && script.isRunning) {
112111
if (script.startup) {
113112
eval(script.startup);
@@ -173,18 +172,24 @@ if (xPref.get(_uc.PREF_SCRIPTSDISABLED) === undefined) {
173172

174173
let UserChrome_js = {
175174
observe: function (aSubject) {
176-
aSubject.addEventListener('DOMContentLoaded', this, {once: true});
175+
if (aSubject != null) {
176+
aSubject.addEventListener('DOMContentLoaded', this, {once: true});
177+
}
177178
},
178179

179180
handleEvent: function (aEvent) {
180181
let document = aEvent.originalTarget;
181182
let window = document.defaultView;
182-
this.load(window);
183+
if (window.parent.location.href == 'chrome://browser/content/browser.xhtml') {
184+
this.load(window.parent);
185+
} else {
186+
this.load(window);
187+
}
183188
},
184189

185190
load: function (window) {
186191
let location = window.location;
187-
192+
Components.utils.reportError(window.location.href);
188193
if (!this.sharedWindowOpened && location.href == 'chrome://extensions/content/dummy.xhtml') {
189194
this.sharedWindowOpened = true;
190195

@@ -232,7 +237,7 @@ if (!Services.appinfo.inSafeMode) {
232237
while (windows.hasMoreElements()) {
233238
let win = windows.getNext();
234239
if (!('UC' in win))
235-
UserChrome_js.load(win)
240+
UserChrome_js.load(win);
236241
}
237242
Services.obs.addObserver(UserChrome_js, 'chrome-document-global-created', false);
238243
}

Multirow and other functions/JS Loader/root/config.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ try {
77
cmanifest.append('utils');
88
cmanifest.append('chrome.manifest');
99
Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);
10-
11-
Services.scriptloader.loadSubScript('chrome://userchromejs/content/BootstrapLoader.js');
12-
} catch (ex) {}
10+
} catch (e) {
11+
Components.utils.reportError(e);
12+
}
1313

1414
try {
15-
Services.scriptloader.loadSubScript('chrome://userchromejs/content/userChrome.js');
16-
} catch (ex) {}
15+
Services.scriptloader.loadSubScript('chrome://userchromejs/content/userChrome.js');
16+
} catch(e) {
17+
Components.utils.reportError(e);
18+
}

Multirow and other functions/JS Loader/utils/userChrome.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ let _uc = {
107107
if (!script.regex.test(win.location.href) || (script.filename != this.ALWAYSEXECUTE && !script.isEnabled)) {
108108
return;
109109
}
110-
111110
if (script.onlyonce && script.isRunning) {
112111
if (script.startup) {
113112
eval(script.startup);
@@ -173,18 +172,24 @@ if (xPref.get(_uc.PREF_SCRIPTSDISABLED) === undefined) {
173172

174173
let UserChrome_js = {
175174
observe: function (aSubject) {
176-
aSubject.addEventListener('DOMContentLoaded', this, {once: true});
175+
if (aSubject != null) {
176+
aSubject.addEventListener('DOMContentLoaded', this, {once: true});
177+
}
177178
},
178179

179180
handleEvent: function (aEvent) {
180181
let document = aEvent.originalTarget;
181182
let window = document.defaultView;
182-
this.load(window);
183+
if (window.parent.location.href == 'chrome://browser/content/browser.xhtml') {
184+
this.load(window.parent);
185+
} else {
186+
this.load(window);
187+
}
183188
},
184189

185190
load: function (window) {
186191
let location = window.location;
187-
192+
Components.utils.reportError(window.location.href);
188193
if (!this.sharedWindowOpened && location.href == 'chrome://extensions/content/dummy.xhtml') {
189194
this.sharedWindowOpened = true;
190195

@@ -232,7 +237,7 @@ if (!Services.appinfo.inSafeMode) {
232237
while (windows.hasMoreElements()) {
233238
let win = windows.getNext();
234239
if (!('UC' in win))
235-
UserChrome_js.load(win)
240+
UserChrome_js.load(win);
236241
}
237242
Services.obs.addObserver(UserChrome_js, 'chrome-document-global-created', false);
238243
}

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ If you only want multirow or any other function that isn't related to the theme
88

99
For anyone looking for the old code like the dark theme or the attempt of a mod loader, you can find it in the **backup/2025-09-12** branch.
1010

11-
### Last update: 03/10/2025
11+
### Last update: 29/11/2025
1212

1313
Files updated:
1414

15-
- __Multirow*uc.js__: Yet more fixes for tab groups.
15+
- __userChrome.js__: Fix to make the js files loader work on FF 147+.
16+
- __config.js__: Added an error logger and removed some deprecated file loading.
1617

1718

18-
### Pre-Last update: 01/10/2025
19+
### Pre-Last update: 03/10/2025
1920

2021
Files updated:
2122

22-
- __Multirow*uc.js__: Fixed some issues while moving tab groups.
23+
- __Multirow*uc.js__: Yet more fixes for tab groups.
2324

2425
### A note on people looking to replace some Tab Mix Plus features:
2526
You can find some of the basic settings that can be simulated through `about:config`, some userscripts, and some addons [here](https://github.com/Izheil/Quantum-Nox-Firefox-Customizations/wiki/Useful-about:config-settings#some-tab-mix-plus-features).

0 commit comments

Comments
 (0)