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

Add support for inter-frame communication on the same tab

Open twschiller opened this issue 3 years ago • 1 comments

Context

  • The PixieBrix sidebar in the context of the top-level frame
  • The PixieBrix content script runs in the context of the frame its in
  • The PixieBrix "broadcast" target exclude the sender tab
  • Documentation: Editing pages with iframes
  • The PixieBrix Page Editor only operates on the top-level tab. This issue is for enabling some enterprise use cases on Salesforce and Service Now which use frames

Options

  • Allow PixieBrix to target sub-frame by URL
  • Allow PixieBrix to target sub-frame frame selector (and PixieBrix figures out the frame id, URL?)
  • Allow PixieBrix to target top-level frame
  • Allow PixieBrix to broadcast to all frames on the page

Assumptions

  • The creator must give PixieBrix permissions to run on both the tab and the sub-frame (so the content script is loaded on the sub-frame)

Discussion

  • The easiest path for now is to support a "tab" target that runs on the top-level frame. That would allow sub-frames to publish context to the top-level frame using "Set Page State"
  • Long term, we'll want enable more seamless brick execution in subframes, which will be the most common direction

twschiller avatar Apr 18 '22 22:04 twschiller

Very related:

  • https://github.com/pixiebrix/webext-messenger/issues/41#issuecomment-1101959013

I left a message there, but #3201 looks good as is too.

fregante avatar Apr 19 '22 03: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 Dec 31 '23 00:12 github-actions[bot]

Closing, because we've implemented support for:

  • Allow PixieBrix to target top-level frame
  • Allow PixieBrix to broadcast to all frames on the page

twschiller avatar Dec 31 '23 14:12 twschiller