pixiebrix-extension
pixiebrix-extension copied to clipboard
Add support for inter-frame communication on the same tab
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
Very related:
- https://github.com/pixiebrix/webext-messenger/issues/41#issuecomment-1101959013
I left a message there, but #3201 looks good as is too.
This issue will be closed in 7 days unless the stale label is removed, or a comment is added to the issue.
Closing, because we've implemented support for:
- Allow PixieBrix to target top-level frame
- Allow PixieBrix to broadcast to all frames on the page