Closed Bug 1523982 Opened 6 years ago Closed 6 years ago

Allow filtering which globals WindowActors apply to

Categories

(Core :: DOM: Content Processes, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Fission Milestone M2
Tracking Status
firefox68 --- fixed

People

(Reporter: nika, Assigned: jdai)

References

Details

Attachments

(4 files)

Additional options should be added to the WindowActorOptions struct to control which globals are permitted to create actors of the given type.

dictionary WindowActorOptions {
  // Allow overriding the matching behaviour for documents specified.
  // If a MozDocumentMatcher is specified, only documents which match
  // are allowed to have the given actor created for them. Other 
  // documents will fail to have their actor constructed, returning
  // `nullptr`.
  (MozDocumentMatcher or MozDocumentMatcherInit) matches;
}

Note that in the initial version, documents which have a matches property will be unable to be constructed directly from the parent process using getActor, as it will not be possible to efficiently check for document matches. In the future this will be relaxed.

Status: NEW → ASSIGNED

I plan to align matching mechanism[1] to the JS Window Actors.

dictionary WindowActorOptions {
// An array of URL match patterns (as accepted by the MatchPattern
// class in MatchPattern.webidl) which restrict which pages the actor
// may be instantiated for. If this is defined, only documents which match
// are allowed to have the given actor created for them. Other
// documents will fail to have their actor constructed, returning
// nullptr.
sequence<ByteString> matches;
}

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns

One thing to highlight is that it's important that the actors get constructed for internal page changes, such as when a normal webpage fails to load, and then internally it's loading about:neterror, even though externally the normal URI.

There are actors that we will want to register only for this type of pages (about:neterror, :certerror, :tabcrashed, etc.)

Priority: -- → P3
Pushed by jdai@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3a212aece7e4 Part 1: Add filtering to control which globals are permitted to create actors, r=nika https://hg.mozilla.org/integration/autoland/rev/1d112c578b34 Part 2: Add testcases for filtering to control which globals are permitted to create actors, r=nika https://hg.mozilla.org/integration/autoland/rev/06a189e6b675 Part 3: Don't raise an error in observe if creation of our actor was vetoed, r=nika https://hg.mozilla.org/integration/autoland/rev/54f0ce4913e0 Part 4: When WindowGlobalChild creating, update WindowGlobalParent document's URI; r=nika
https://hg.mozilla.org/projects/ash/rev/3a212aece7e4ae048615644fa52699ceeb1d9b88 Bug 1523982 - Part 1: Add filtering to control which globals are permitted to create actors, r=nika https://hg.mozilla.org/projects/ash/rev/1d112c578b34f040b662e5d602bb2663f6191259 Bug 1523982 - Part 2: Add testcases for filtering to control which globals are permitted to create actors, r=nika https://hg.mozilla.org/projects/ash/rev/06a189e6b675149d77a254e6e4678c9c898d3158 Bug 1523982 - Part 3: Don't raise an error in observe if creation of our actor was vetoed, r=nika https://hg.mozilla.org/projects/ash/rev/54f0ce4913e043c1eddbb18704a2f0d1d4d1c4d5 Bug 1523982 - Part 4: When WindowGlobalChild creating, update WindowGlobalParent document's URI; r=nika
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: