-
Notifications
You must be signed in to change notification settings - Fork 0
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
Clarification: package uses onExtensionStart (not chrome.runtime.onInstalled) #16
Comments
Yeah the package name is not a 100% match. The purpose of the package is to have the content script available when the extension is running. This means:
Also see a related request to bring this behavior to Chrome: Are you seeing issues with the MV3 restart? That should have been fixed by #9 |
We're seeing reinjection on extension reload, which I wasn't expecting from reading the code, given the name of the package. So just figured I'd raise in case anyone else comes across this behavior |
Yes, that's expected. The content script in pixiebrix is deactivated before the reload (onContextInvalidated) so a new one needs to be injected in order to receive messages, restore menuitems and the various triggers. This is not MV3 specific. If you're seeing reinjection when the service worker reloads, I should look into #9 again. |
👍 It was causing a race condition on code that was assumed to run on the next tab to be opened/redirected (and not all existing tabs). We added a fix to address the injection into existing tabs/frames |
Can you point me to the ticket/PR? I'm not following the sequence of events that leads to the race condition. All tabs will get the content script in PB, whether via this module or natively via the manifest. PB also protects itself from duplicate injections so I think that shouldn't be an issue either (even if ideally it shouldn't happen at all) |
There were/are parts of the codebase (e.g., mod activation from marketplace activation links) that were not properly considering content script injection on extension reload. (IIRC, you only considered UI elements with the context invalidation work/startup work) We handled one of the race condition/injection bugs here: pixiebrix/pixiebrix-extension#8502 There's nothing to look at, on our side we just need to double-check assumptions about injection order |
Context
The text was updated successfully, but these errors were encountered: