AutoplayPolicy incorrectly thinks we have 'autoplay-media' permission when we're sharing screen
Categories
(Core :: Audio/Video: Playback, enhancement, P5)
Tracking
()
People
(Reporter: alwu, Assigned: alwu)
References
Details
While I was testing my patches from bug1520088, I found that nsContentUtils::IsExactSitePermAllow
would return incorrect result even if the principle doesn't have that permission type.
For example, calling nsContentUtils::IsExactSitePermAllow(aPricinple, "wtf")
would return true. That function returned true from [1].
My usage scenario is in AutoplayPolicy
, I would use top level document's principle to check whether sites have autoplay-media
permission or not. I don't want it return true when site doesn't have that permission.
Assignee | ||
Comment 1•6 years ago
|
||
Hi, Smaug,
Could you help me take a look for this bug? or help me direct this NI to person who can help.
Thank you!
Assignee | ||
Comment 2•6 years ago
|
||
FYI, I was testing this site [1], and then I found IsExactSitePermAllow(aPricinple, "autoplay-media")
would return true after I got the screen
permission.
[1] https://www.webrtc-experiment.com/screen-sharing/#21212466423507326
Comment 3•6 years ago
|
||
Are you passing wrong principal?
https://searchfox.org/mozilla-central/rev/c21d6620d384dfb13ede6054015da05a6353b899/extensions/cookie/nsPermissionManager.cpp#2310-2313 makes very much sense, since it is dealing system principal.
Assignee | ||
Comment 4•6 years ago
|
||
After some investigation, the autoplay checking for playing screen sharing happened on the chrome process, so we actually passed the system pricinple to the permission manager, which means nsContentUtils::IsExactSitePermAllow()
is good without problem.
So now I will investigate why this happen on the chrome process, instead of child process, because it seems to me that the sharing content is the part of child process.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 5•6 years ago
|
||
This is a low priority bug, won't cause any bug, I just curious about some unexpected behaviors.
Updated•2 years ago
|
Description
•