1

I am creating a chrome extension which supposed to grab google translate chrome extension html response , using javascript.

This grabber extension should wait until that popup become visible.

But when I use GetElementbyID , the result is null.

document.getElementById("bubble-content");

I know it is because the page source had downloaded before the javascript has worked. But can I even fetch this pop up in a way?

I thank you if you say How ? enter image description here

enter image description here

Parsa
  • 7,995
  • 2
  • 27
  • 37
  • 1
    Your screenshot shows it's inside ShadowDOM so you can't get it directly. Moreover it's `closed` so you'll have to hook the original attachShadow method in [page context](/a/9517879). Not rocket science, but quite a few advanced concepts anyway, still should be totally doable. – wOxxOm Aug 28 '20 at 14:04
  • @wOxxOm I read the link you mentioned , but yet I have no idea how can I fetch that "bubble-content" , do you have any idea ? Thank You – Parsa Sep 05 '20 at 17:19
  • 1
    See [this extension](https://github.com/tophf/XRayStyler/tree/shadow-targeting/content) for an example of hooking attachShadow in page context. – wOxxOm Sep 05 '20 at 17:24
  • Thank you for quick answer ! , I will check that out. – Parsa Sep 05 '20 at 17:26

0 Answers0