Skip to content

#385 - force unsafe URL loading to enable TB155 compatibility - #386

Merged
RealRaven2000 merged 1 commit into
ESR140from
windowlistener-loadsubscript-compat
Aug 12, 2026
Merged

#385 - force unsafe URL loading to enable TB155 compatibility#386
RealRaven2000 merged 1 commit into
ESR140from
windowlistener-loadsubscript-compat

Conversation

@RealRaven2000

Copy link
Copy Markdown
Owner

using loadSubScriptWithOptions() to force unsafe URL. This is to fix the Add-on not loading anymore in Thunderbird 155 Daily because untrusted URI issues caused by Bug 1974213 "Don't allow file: and jar: schemes in Services.scriptloader.loadSubScript"

using loadSubScriptWithOptions() toforce unsafe URL
@RealRaven2000
RealRaven2000 requested a lite review from Copilot August 12, 2026 15:14
@RealRaven2000 RealRaven2000 self-assigned this Aug 12, 2026
@RealRaven2000
RealRaven2000 merged commit d7b901e into ESR140 Aug 12, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates subscript loading to explicitly opt into unsafe URL loading via Services.scriptloader.loadSubScriptWithOptions(), restoring compatibility with Thunderbird 155+ where loadSubScript() rejects jar:/file: URIs (per Bug 1974213).

Changes:

  • Replaced loadSubScript() with loadSubScriptWithOptions() (using allowUnsafeURL: true) for key scripts loaded from the extension package.
  • Added early-startup handling in logDebug() to avoid consulting preferences before they’re initialized.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
chrome/content/qFilters-utils.js Switches two subscript loads to loadSubScriptWithOptions(…, { allowUnsafeURL: true }) and adjusts early-startup debug logging.
chrome/content/api/WindowListener/implementation.js Introduces a loadSubScript() wrapper using loadSubScriptWithOptions() and updates call sites to use it.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +312 to +315
{
target: window,
allowUnsafeURL: true,
}
// qFilters-preferences.js subscript has finished loading. We cannot yet
// consult the debug preference, so preserve the diagnostic unconditionally.
if (!qF?.Preferences) {
this.logToConsole("quickFilters [preferences not initialized]", ...args);
Comment on lines +3450 to +3453
{
target: quickFilters.Util,
allowUnsafeURL: true,
}
Comment on lines +52 to +55
return Services.scriptloader.loadSubScriptWithOptions(url, {
target,
allowUnsafeURL: true,
});
@RealRaven2000

Copy link
Copy Markdown
Owner Author

Prerelease, tested on Thunderbird Daily 155.0a1 (2026-08-12) (64-bit)

quickFilters-6.13.3pre5.zip


To install the version above, download the zip file and then drag the file into Thunderbird Add-ons Manager. Do not extract contents, it will not install that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants