Enabling Trusted Types causes issues with Picture-in-Picture on www.youtube.com
Categories
(Core :: DOM: Security, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr128 | --- | unaffected |
firefox135 | --- | disabled |
firefox136 | --- | disabled |
firefox137 | --- | fixed |
People
(Reporter: celenity, Assigned: tschuster)
References
(Blocks 2 open bugs, Regression)
Details
(Keywords: regression)
Attachments
(2 files)
Steps to reproduce:
-
Set
dom.security.trusted_types.enabled
totrue
(via yourabout:config
or otherwise...) -
Navigate to
https://www.youtube.com
, find and play a video, it doesn't matter what. -
Activate Picture-in-Picture via the icon on the top right of the URL bar.
Actual results:
The video pops out with PiP, but also still continues playing on the https://www.youtube.com
tab.
Expected results:
Video playback should stop on the https://www.youtube.com
tab when PiP is active, just like it does when Trusted Types is disabled.
Assignee | ||
Updated•12 days ago
|
Assignee | ||
Comment 1•12 days ago
|
||
This is a great report. Thank you!
The problem must be the following:
TypeError: DOMParser.parseFromString: Sink type mismatch violation blocked by CSP
generateContent chrome://global/content/elements/videocontrols.js:3304
onsetup chrome://global/content/elements/videocontrols.js:3163
Our PiP code seems to be trying to parse a string using a content based DOMParser that is blocked by the Trusted Types policy set up by YouTube. We probably could/should either bypass the policy somehow (Using [NeedsCallerType]
on parseFromString
?) or stop parsing in that context.
Assignee | ||
Updated•12 days ago
|
Comment 2•12 days ago
|
||
Set release status flags based on info from the regressing bug 1931282
:fredw, since you are the author of the regressor, bug 1931282, could you take a look?
For more information, please visit BugBot documentation.
Comment 4•11 days ago
|
||
Is the JS global of the PiP code not a Window? If so maybe, the patch from bug 1942517 helps? Otherwise, the PiP code will probably need to wrap the parameters into a trusted type to bypass the default policy check...
Assignee | ||
Comment 5•11 days ago
|
||
Updated•11 days ago
|
Comment 7•10 days ago
|
||
bugherder |
Updated•10 days ago
|
Description
•