Skip to content
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

Firefox optional permissions #102

Merged

Conversation

mikeydevelops
Copy link
Contributor

I want to open this by saying I am sorry for not being thorough enough when implementing custom domains on Firefox. I misinterpreted the mdn page about optional_permissions for Firefox. Since Chrome had host_permissions and optional_host_permissions, I thought, when I saw that Firefox supports host_permissions, that it also supports optional_host_permissions and when I researched I didn't find that it [Firefox] did support it. It turns out Firefox accepts websites in optional_permissions.

So this pull request allows us to remove all origins from the permissions on install time, and request them when needed.

Due to fact that Firefox could not detect requesting permissions from background script as being triggered from user action I found a way to remove the background script fully. Previously I had a problem not correctly detecting when a permission was granted and the way I found to fix it was through the background script. Now when I last changed the background script to allow multiple custom domains to be registered, it now allowed me to move the whole logic in the settings popup.

On Firefox there was a warning in the devtools that it was running in quirks mode, whatever that is, and it suggested to add <DOCTYPE html to the html, so I did and the warning is no more.

Closes #99 and #36 (comment)

Copy link
Member

@PKief PKief left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested it both on Chrome and Firefox and it worked super good!

@PKief PKief merged commit 0e30ba8 into material-extensions:main Jul 9, 2024
1 check passed
@mikeydevelops mikeydevelops deleted the firefox-optional-permissions branch July 9, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firefox manifest is not properly configured
2 participants