pixiebrix-extension icon indicating copy to clipboard operation
pixiebrix-extension copied to clipboard

`ensureContentScript` fails on *.pixiebrix.com after an extension reload

Open fregante opened this issue 3 years ago • 1 comments

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
  • 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-scripts does
    • 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

  1. Ensure you don't have *:/*/* (due to an injection bug)
  2. Open pixiebrix.com
  3. Reload extension
  4. 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

fregante avatar Aug 31 '22 07:08 fregante

Related

  • https://github.com/pixiebrix/pixiebrix-extension/issues/4124
  • https://github.com/pixiebrix/pixiebrix-extension/issues/4190

fregante avatar Aug 31 '22 08:08 fregante

Fixed by https://github.com/pixiebrix/pixiebrix-extension/pull/5899

fregante avatar Jun 22 '23 17:06 fregante