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

The Page Editor does not always update when clicking the browser’s back button

Open fregante opened this issue 3 years ago • 5 comments

Repro

  1. Visit website A with host permissions
  2. Open page editor
    • ✅ See "No extension selected" screen
  3. Visit website B (regardless of permissions)
    • ✅ Editor updates correctly
  4. Click the browser’s Back button
    • ❌ Editor still shows the old bricks
  5. Refresh the page (not the editor)
    • ✅ Editor updates correctly

Sub-repro

Do the same, but between websites that have no host permissions and step 6/7 works correctly

Demo

See how the editor shows "Enable on nytimes" even after going back to pbx

https://user-images.githubusercontent.com/1402241/189355233-e07c1d62-cd9d-4a7f-8596-1dee42c52aff.mov

Solution

Ensure that whatever event we're using to listen to the URL change also responds correctly to history navigation events.

fregante avatar Sep 09 '22 12:09 fregante

Similar: it seems that hasTabPermission isn't updated sometimes:

https://user-images.githubusercontent.com/1402241/208247255-f276106c-6f5b-4dae-9e5c-10c4afb39ee1.mov

You can verify this by adding console.log({tabHasPermissions, isConnectingToContentScript}) in EditorContent.tsx

fregante avatar Dec 17 '22 14:12 fregante

This is still an issue, even disregarding the host permission.

The information in the sidebar is actually wrong even after the page reload.

Here all the extensions are available on PBX, but after the navigation and reload they're still marked as unavailable:

https://github.com/pixiebrix/pixiebrix-extension/assets/1402241/cb1bd3fd-b09c-4f81-9d19-99683952d96c

fregante avatar Jan 05 '24 04:01 fregante

This issue will be closed in 7 days unless the stale label is removed, or a comment is added to the issue.

github-actions[bot] avatar Apr 05 '24 00:04 github-actions[bot]

Issue still seen:

  1. Open page editor
  2. Add mod on https://pbx.vercel.app/
  3. Visit https://google.com
    • crossed eye appears ✅
  4. Go back
    • crossed eye does not disappear ❌

This is probably a small issue. https://github.com/pixiebrix/pixiebrix-extension/pull/8074 would have fixed it but that was the wrong "event" to listen to.

fregante avatar Apr 07 '24 10:04 fregante

This issue will be closed in 7 days unless the stale label is removed, or a comment is added to the issue.

github-actions[bot] avatar Jul 07 '24 00:07 github-actions[bot]

This issue was closed because it has been stale for 7 days with no activity.

github-actions[bot] avatar Jul 14 '24 00:07 github-actions[bot]