Allow a 1:1 relationship between UserScript and a script context for a frame

Bug #1495252 reported by Chris Coulson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Oxide
Triaged
Medium
Unassigned

Bug Description

Currently there is a 1:1 relationship between UserScript and a file on disk. If the embedder wants to load more than 1 file in to a script context, it creates multiple UserScript objects with the same context.

At the moment, we have nowhere to customize settings for a script context in which user scripts execute. Things we might want to customize are:
- Should the context be debuggable in devtools?
- CSP settings
- Security origin

These would make sense on UserScript, if UserScript had a 1:1 relationship with a script context within a frame. I think we update UserScript to allow this.

What I propose is:

- Deprecate creating more than 1 UserScript with the same context (allow it for now, but print a warning if an application does that).
- Provide a new property to allow the embedder to specify multiple script URLs.
- Provide APIs to control when / where the scripts are injected (equivalent to greasemonkey's include, exclude, run-at), and ignore inline greasemonkey metadata for multiple-source UserScripts.
- UserScripts that inject a single source (using UserScript.url) will still be able to be controlled using inline greasemonkey metadata

Changed in oxide:
importance: Undecided → Medium
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.