The Page Editor does not always update when clicking the browser’s back button
Repro
- Visit website A with host permissions
- Open page editor
- ✅ See "No extension selected" screen
- Visit website B (regardless of permissions)
- ✅ Editor updates correctly
- Click the browser’s Back button
- ❌ Editor still shows the old bricks
- 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.
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
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
This issue will be closed in 7 days unless the stale label is removed, or a comment is added to the issue.
Issue still seen:
- Open page editor
- Add mod on https://pbx.vercel.app/
- Visit https://google.com
- crossed eye appears ✅
- 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.
This issue will be closed in 7 days unless the stale label is removed, or a comment is added to the issue.
This issue was closed because it has been stale for 7 days with no activity.