support icon indicating copy to clipboard operation
support copied to clipboard

Firemonkey: Target an `<iframe/`> in a shadow DOM?

Open simonwiles opened this issue 1 year ago • 3 comments

I want to execute a script in the context of an iframe (cross-origin) that's loaded in the shadow DOM of a web component. Obviously I can't do this from javascript executed in the context of the parent document because of the cross-origin policy, but also Firemonkey isn't matching the document in the iframe when its inside a shadow DOM (it works with a regular iframe).

Is this something that could be "fixed" in Firemonkey? Are there any workarounds available to me?

Thanks!

simonwiles avatar Jul 02 '24 21:07 simonwiles

Is this something that could be "fixed" in Firemonkey?

There are discussions in the WebExtensions Community Group (WECG) currently, regarding the shadow DOM access.

Are there any workarounds available to me?

I have not tested it so I am unaware of the possibilities.

erosman avatar Jul 03 '24 04:07 erosman

I was hoping/expecting that my script would be injected when the iframe loaded its document (my @match matches the correct URI), as would be the case if the iframe is in the light DOM. I see the problem is more complicated than I realized. Thanks for your response 👍️.

simonwiles avatar Jul 03 '24 04:07 simonwiles

See also: #547

erosman avatar Dec 20 '25 14:12 erosman