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

Indicate in Page Editor if page did a full navigation while a brick was running

Open twschiller opened this issue 3 years ago • 2 comments

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

twschiller avatar Aug 01 '22 21:08 twschiller

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

fregante avatar Aug 02 '22 07:08 fregante

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

twschiller avatar Aug 03 '22 13:08 twschiller

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 Dec 22 '23 00:12 github-actions[bot]

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

github-actions[bot] avatar Dec 30 '23 00:12 github-actions[bot]