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 restart Brave loses permission #450

Open
Anteus opened this issue Nov 1, 2022 · 12 comments
Open

Firefox restart Brave loses permission #450

Anteus opened this issue Nov 1, 2022 · 12 comments

Comments

@Anteus
Copy link
Contributor

Anteus commented Nov 1, 2022

On Firefox when restarting the browser the permission for Brave doesn't work. It's still toggled in settings but only a retoggle of the permission or a disable and enable of the extension makes it work again until the next restart. Have checked and the extension is not injected into the Brave search page after a restart of Firefox. Tried with all other addons disabled and reset privacy settings.

@infokiller
Copy link
Owner

Thanks for the report, are you able to reproduce this in Chrome?

@Anteus
Copy link
Contributor Author

Anteus commented Nov 1, 2022

Thanks for the report, are you able to reproduce this in Chrome?

No it works fine in Chrome/Edge.

@infokiller
Copy link
Owner

OK great, I was able to reproduce this. Hope to fix it soon

Anteus added a commit to Anteus/web-search-navigator that referenced this issue Nov 4, 2022
@Anteus
Copy link
Contributor Author

Anteus commented Nov 4, 2022

Got it working in Firefox. Will propose the fix upstream too.
https://github.com/fregante/webext-content-scripts/blob/73094bd60792f8fcce5515d6fbfef6725d6f4132/index.ts#L129

@Anteus
Copy link
Contributor Author

Anteus commented Nov 4, 2022

Got it working in Firefox. Will propose the fix upstream too. https://github.com/fregante/webext-content-scripts/blob/73094bd60792f8fcce5515d6fbfef6725d6f4132/index.ts#129

It worked while running the debugger from VSCode with a Firefox profile but not when loaded manually.

Edit: any clue what it could be?

It also picks up the permission and runs while running the debugger about:debugging#/runtime/this-firefox. Just have to press the refresh button in there first.

@infokiller
Copy link
Owner

No idea, possible a Firefox bug?
Maybe worth checking on older Firefox versions

@infokiller
Copy link
Owner

Turns out I'm not even able to see the content script in the debugger, even from a new Firefox profile

@Anteus
Copy link
Contributor Author

Anteus commented Nov 6, 2022

Turns out I'm not even able to see the content script in the debugger, even from a new Firefox profile

I got it working by removing background persistent=false it's in the updated pull request. If you open the debugger about:debugging#/runtime/this-firefox you can see that the script is not running after a restart. You can trigger it to run by enable/disable the extension, or in the debug menu chose inspect and then hit the update button. But I think it will be stopped in a few minutes again.

@infokiller
Copy link
Owner

For me, removing persistent=false doesn't change anything. Debugging the extension does work with web-ext, so maybe the issue is specific to my firefox config/state.

@Anteus
Copy link
Contributor Author

Anteus commented Nov 6, 2022

Forgot to add that I've only tried on Firefox Dev as temporary addons get removed on restart.

@Anteus
Copy link
Contributor Author

Anteus commented Nov 6, 2022

@fregante
Copy link

fregante commented Mar 8, 2023

Has this been fixed? In recent Firefox versions, webext-dynamic-content-scripts uses the new chrome.scripting.registerContentScript API, which should work in event pages as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants