-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MV3] Clarify browser inconsistency for temporary host permissions granted on extension click #657
Comments
Note that I personally prefer the Chrome behavior. I contribute to the extension Ruffle, used for Flash Player emulation. At document start Ruffle registers a content script with the MAIN ExecutionWorld to polyfill navigator.plugins, so pages that do Flash detection by checking that are fooled. That script won't work unless it's run at document start. |
Safari behaves like Firefox, where the styles and scripts are injected in all open tabs that match the newly granted host permissions. |
We added this code, which is necessary on Firefox and according to xeenon Safari, but not Chromium: https://github.com/ruffle-rs/ruffle/blob/master/web/packages/extension/src/background.ts#L62-L72 When that is true the extension popup shows a reload button. We needed that because some pages won't work with our extension if the content scripts don't run on document start. That only shows after you grant permanent host permissions; we show a button to grant permanent host permissions in the popup if you haven't granted them for the tab already. On Firefox the flow to run those sometimes necessary scripts is: Click popup --> click button to grant permanent permissions --> accept new permissions (this usually dismisses the popup because the toast is usually outside the popup) --> re-open popup and click reload button or manually reload the page. On Chrome the flow to run those sometimes necessary scripts is: Click popup --> click browser's built-in reload tab button that pops up. You can then grant permanent permissions with the button in the popup but you don't have to because the necessary scripts already ran. |
You don't really need the last step to be manual, you get the event when your extension is granted permission, and if you need to run a script that requires a reload, you can do that automatically using |
You're right of course, and originally it wasn't manual, but for our use-case it's better if it is manual, so I merged ruffle-rs/ruffle#17082. The content script that runs on document start is only necessary on certain websites (in particular, websites with scripts that decide whether to show Flash content on document load by checking for Shockwave Flash in |
I will say, regardless of the decision made here about anything else, I personally think it would be nice if temporary host permissions granted through a click on the extension action lasted through a page refresh on Firefox like they do on Chromium. |
Also, another minor annoyance I had, should clicking "Allow" on the toast that appears after clicking a button in the extension popup that requests host permissions be dismissing the popup? I guess it makes sense, but it just made it more annoying to check if permissions were granted by someone clicking the button in the popup, which could have been done with a |
Here's the relevant Firefox issue: https://bugzil.la/1805687. |
In Chrome: If you click an extension icon on a tab on which you have not granted host permissions, it requires that you refresh the page before it will load the extension. You can reload the page as many times as you want without permanent host permissions and it will load the extension each time, until you close the tab.
In Firefox: If you click the extension icon on a tab on which you have not granted host permissions it automatically loads the extension. If you refresh the page, it requires another click.
I am unsure of the Safari behavior.
The text was updated successfully, but these errors were encountered: