onclick attr item inside an iframe, not working in some pages

So I am buildning a html devtools for mobile.

this i do by injecting script and an iframe into the page, and it work fine.

I encounter some odd issue.
Ihave this code which work on all pages except google and webnovel for some reason.

tagStart.el.setAttribute(
             "onclick",
             "window.event.stopImmediatePropagation();this.classList.toggle('readmode');this.querySelector('emchild>.emtext').classList.toggle('readmode')"
             );

this element exist inside an iframe, any reason why it dose not click when i am on some pages.

the i frame and its container have max zindex

note:i am not using any url, i am injecting a script that create an iframe and add html to it. using webview

  • emchild is not a valid HTML5 tag. You meant to query for class .emchild instead?

    – 




  • nee it is a custom component

    – 

Leave a Comment