Closed Bug 1739643 Opened 3 years ago Closed 3 years ago

scripting.executeScript should support injection of scripts in about:blank / sandboxed pages

Categories

(WebExtensions :: General, enhancement, P2)

enhancement
Points:
3

Tracking

(firefox98 fixed)

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: robwu, Assigned: willdurand)

References

(Blocks 1 open bug)

Details

(Whiteboard: [mv3-m2])

Attachments

(1 file)

For static / dynamically registered content scripts, it is possible to specify whether scripts should be injected in about:blank / data:-URLs / sandboxed pages /blob:-URLs, etc.

tabs.executeScript should support the ability to run in these scripts. The tabs.executeScript API has the matchAboutBlank option, but we should probably either set this option to true by default, or introduce a new option (for context, see https://bugzilla.mozilla.org/show_bug.cgi?id=1411641#c41 and https://bugzilla.mozilla.org/show_bug.cgi?id=1475831#c16).

It may probably be easier to unconditionally set matchAboutBlank to true in the implementation of parent/ext-scripting.js, so that this code path is triggered: https://searchfox.org/mozilla-central/rev/d2f8488b6a704443a5c5bfc6d2878171b5f0d393/toolkit/components/extensions/parent/ext-tabs-base.js#791. The flag is ultimately checked at https://searchfox.org/mozilla-central/rev/d2f8488b6a704443a5c5bfc6d2878171b5f0d393/toolkit/components/extensions/WebExtensionPolicy.cpp#701-713

A unit test to check this scenario is <iframe srcdoc> and/or <iframe> (about:blank).

Priority: -- → P2
Whiteboard: [mv3-m2]
Type: task → enhancement
Severity: -- → N/A
Points: --- → 3
Depends on: 1751154
Assignee: nobody → wdurand
Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/08992a56ad52 Allow `scripting.executeScript()` to inject into about:blank/sandboxed pages. r=robwu
Regressions: 1751551
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch

The sandbox injection depends on fixing bug 1411641.

Depends on: 1411641
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: