Support principals `file://` for the site permission setting
Categories
(Firefox :: Site Permissions, defect, P3)
Tracking
()
People
(Reporter: jya, Assigned: gaurijove, Mentored)
References
Details
Attachments
(1 file)
Was trying to debug bug 1528265.
I have a local page that will autoplay a flac page.
playback doesn't start and in the console you see:
NotAllowedError: The play method is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
Attempting to modify the autoplay permission by selecting "Permissions -> Autoplay : Allow Audio and Video" in the URL bar has no effect. Autoplay is always blocked for local file.
This is probably a toolkit bug, but wasn't sure.
Comment 1•5 years ago
•
|
||
What file did you play? And what pref do you have for media.autoplay.*
?
We won't block any media playing from the top level video document [1], and I can't reproduce this issue.
Reporter | ||
Comment 2•5 years ago
|
||
(In reply to Alastor Wu [:alwu] from comment #1)
What file did you play? And what pref do you have for
media.autoplay.*
?
We won't block any media playing from the top level video document [1], and I can't reproduce this issue.
A local web page, I got from there:
https://bug1487797.bmoattachments.org/attachment.cgi?id=9020902
And manually adjusted so that the flac file it played was local.
Settings are default, happening on both my local central build after a clobber (started with ./mach run) or firefox nightly.
Comment 3•5 years ago
|
||
Would you mind to paste all the value of the pref media.autoplay.*
, or simply paste the info from about:support
?
The Flac file can be played successfully on both latest own-build-central and latest Nightly.
Comment 4•5 years ago
|
||
After discussed with jya offline, so this issue seems to me a site permission issue.
He opened a local file which would automatically play a Flac file in that page and that autoplay would be blocked by our autoplay policy. That is expected, and from blocking autoplay pespective that is not difference between a page from local or from internet. The only case we would allow media to autoplay for local file is that you open an local media file directly.
Then he wanted to add this file file:///....
to the setting list, but it didn't help. So the problem is that our setting list doesn't support adding a local file URL.
Reporter | ||
Comment 5•5 years ago
|
||
(In reply to Alastor Wu [:alwu] from comment #4)
Then he wanted to add this file
file:///....
to the setting list, but it didn't help. So the problem is that our setting list doesn't support adding a local file URL.
Adding to that, selecting in the top bar to allow permanently autoplay to work has no effect.
I believe autoplay should be disabled for all local files.
Comment 6•5 years ago
|
||
I was able to reproduce this.
When updating the autoplay permission via the site identity doorhanger SitePermissions.setForPrincipal
is called, which in this case is a no-op because we don't support file://
principals.
In order to support this use case we either have to allow setting permissions for file URIs or allow autoplay for all file URI sources. I'm in favor of the latter.
Another option would be to not support this particular use case and disable the autoplay permission UI for file URIs. That would mean leaving the autoplay permission locked to the default state for these URIs.
Comment 7•5 years ago
|
||
OK, thank you for suggestions. I would leave this bug as to supporting file://
principals and file another bug to handle autoplay policy for local files.
Comment 8•5 years ago
|
||
Ok, I've talked to :johannh about this. We could support permissions for file://
. Since the permission manager already supports them, we would only have to update SitePermissions.jsm
to support file URIs.
Assignee | ||
Comment 9•5 years ago
|
||
Hi May I work on this?
This is quite new to me, may I know exactly what changes need to be made to the file?
Comment 10•5 years ago
•
|
||
(In reply to Jayati Shrivastava from comment #9)
Hi May I work on this?
This is quite new to me, may I know exactly what changes need to be made to the file?
The SitePermissions module uses isSupportedPrincipal
to check whether it can manage permissions for a principal. You need to update the method to allow the file
scheme.
To get some test coverage, you should also add SitePermissions tests where you get/set/test permissions with a principal with file URI.
Finally we should run this on try so we make sure to not break anything.
Assignee | ||
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
Comment 13•5 years ago
|
||
bugherder |
Description
•