0

I refer to this Greasemonkey against an iframe using @include - does this work?

Unfortunately, it doesn't work, because the iframe is not loaded at first, and the domain in iframe is cross domain.

the userscript run only at page first loaded, not run at other time, even I register a domloaded event, the script runs at parent windows stills not handle the iframe

zhengwei
  • 41
  • 5
  • sorry for that, this link doestn't work, link works at page loading at first, I tested it. the iframe is dynamic created, so methods in link can't work. – zhengwei Apr 11 '18 at 02:48
  • So far as I can tell, there aren't any cross-domain restrictions involved here. I'm not sure what happens if the iframe isn't present when the page is first loaded (which is when Greasemonkey runs). npdoty said, he was also not sure – zhengwei Apr 11 '18 at 02:50
  • You said that the iframe is cross domain. That means that it must have a `src` property and will be processed by Greasemonkey and Tampermonkey per the linked questions. If you have a different case (extremely unlikely), edit this question to **provide an MCVE** (which should be there anyway) and it can be reopened. – Brock Adams Apr 12 '18 at 01:13

0 Answers0