Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLACEHOLDER: allow bricks to target frame on same page #1603

Closed
twschiller opened this issue Oct 9, 2021 · 3 comments
Closed

PLACEHOLDER: allow bricks to target frame on same page #1603

twschiller opened this issue Oct 9, 2021 · 3 comments
Labels

Comments

@twschiller
Copy link
Contributor

Context

  • Currently we support targets: self, opener, target, broadcast
  • Want to fill a form in a different iframe using the form fill brick

Questions

  • How to select which frame to run the brick on? E.g., combination of URL and isAvailable? (Which might match multiple frames)
@fregante
Copy link
Contributor

fregante commented Oct 9, 2021

An iframe is just an element on the page, so it should be selected via the usual element picker. The issue then is being able to communicate to it or even inject the content script if it's not on the same domain.

Ideas:

  • when the iframe is picked, ask for an extra permission (on save or whenever)
  • once the content script is loaded, it can receive messages via getContentScriptMethod, as long as we have the frame ID

I'm not entirely sure about how to match an iframe element with their frame ID, even if we get a list of frames via browser.webNavigation.getAllFrames. If there's only one iframe it might "as easy as" matching it via whoAmI or page URL, but if there are multiple frames with the same URL then… 🤔

@twschiller
Copy link
Contributor Author

twschiller commented Oct 18, 2021

An iframe is just an element on the page, so it should be selected via the usual element picker. The issue then is being able to communicate to it or even inject the content script if it's not on the same domain.

This issue hasn't been fully fleshed out yet. What was written so far was just on the runtime (i.e., how can an extension specify inter-frame communication). The devtools is a whole other can of worms (I don't know much at all about supporting selecting across multiple frames in the dev tools)

I added a comment in the pixiebrix/webext-messenger#41 thread that explains the context / use case behind this ticket more. Basically, this ticket was written about 3rd party frames

@twschiller
Copy link
Contributor Author

Closing because we now support "all frames" target on page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants