pixiebrix-extension
pixiebrix-extension copied to clipboard
`ensureContentScript` fails on *.pixiebrix.com after an extension reload
I mentioned this before but apparently I did not open an issue.
ensureContentScript doesn't take any action in some cases:
- when the extension was granted access to the host
- because injection is handled by
webext-dynamic-content-scripts
- because injection is handled by
- when manifest already includes the host
- because injection is handled by the browser
There's one small case that's not covered though:
- after an extension reload, the browser won't inject the extension onto existing tabs like
webext-dynamic-content-scriptsdoes- you can see this behavior when installing any new web extension and nothing happens until you refresh the open tabs
Marking this as low priority as extension reload/update is rare, but we actually do it on install, so it could potentially affect users during boarding.
Repro
- Ensure you don't have
*:/*/*(due to an injection bug) - Open pixiebrix.com
- Reload extension
- Click browser action on the pixiebrix.com tab
Real-world scenarios
- user has multiple pixiebrix.com tabs open, installs extension; PB won't work on those tabs
- the user is on app.pixiebrix.com and the extension is silently updated in the background
Related
- https://github.com/pixiebrix/pixiebrix-extension/issues/4124
- https://github.com/pixiebrix/pixiebrix-extension/issues/4190
Fixed by https://github.com/pixiebrix/pixiebrix-extension/pull/5899