Indicate in Page Editor if page did a full navigation while a brick was running
Context
- When a tab does a full navigation (loading a new page) any bricks running on the current page will stop running because the content script is unloaded
- This can be confusing in browser automation use cases, e.g., clicking a button, running a search
- As extension creator, I want to receive a warning if the extension I'm editing in the page editor stopped running due to a page navigation
It sounds like this should be part of the brick sidebar, turning an "in progress" symbol into a specific error symbol. Slightly related:
- https://github.com/pixiebrix/pixiebrix-extension/issues/3573
It sounds like this should be part of the brick sidebar, turning an "in progress" symbol into a specific error symbol
I agree. Our current tracing infrastructure makes this a bit tricky to implement.
I think the implementation sketch is to let the background page know which (instance id x tabs) are running. (We only need to handle top-level frames because the Page Editor works on the top-level frame)
- In the runtime, if a block config with an instance id is encountered, send the background page a message with (instance id, tab)
- When the block finished running, send a message with (instance id, tab) tab to the background page
- On a redirect of the top level frame of a tab, the background page find all blocks that are still in progress and adds trace exit error record to those blocks, with error that the tab navigated away
Discussion
- This sort of approach would also be helpful for non-trace error logging. But we'd need the runtime to generate nonces for the bricks so the background page can track start/finish of the brick
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.