How can two instances of a userscript communicate between frames?
问题 Refer to the technique of having the same JavaScript to run in both a web page and an iframe, as described in this answer: For example, suppose you have this page at domain_A.com: <html> <body> <iframe src=\"http://domain_B.com/SomePage.htm\"></iframe> </body> </html> If you set your @match directives like this: // @match http://domain_A.com/* // @match http://domain_B.com/* Then your script will run twice -- once on the main page and once on the iframe as though it were a standalone page.