Reputation: 61
I have a chrome extension which consists of a userscript that has been packaged up so that Chrome users don't have to bother with Tampermonkey.
The page on which the script runs consists of multiple frames, for example, if you navigate to site/game.php, the page is made up of 3 frames like so:
In Firefox, and previously in Chrome I could add "main.php" to the include globs, and my script would run on that frame whenever I loaded game.php at the top level. However, in the latest version (Chrome 27.0.1453.93 m) I can only run the script on the top level "game.php". The browser doesn't even bother trying to run on any of the frames. I suspect this is part of the same set of security enhancements that removed the "unsafeWindow" hack.
Is there a way to force Chrome to actually pay attention to my include_globs in the manifest again, or do I really have to change the script so that I waste time inside game.php checking all the frames and seeing which one is the one I want to run on?
game.php doesn't always have the same frames, the urls change depending on where the user clicks, so I'd have to check each one to find out where I was, and that's an overhead I'd prefer to avoid.
Thanks
Edit: Seems to be related to this bug
Upvotes: 4
Views: 638
Reputation: 61
Set "all_frames" under content_scripts to true, apparently this now defaults to false in the extension manifest.
{
"manifest_version": 2,
"icons": { "48": "logo48.png", "128": "logo128.png" },
"name": "My Script",
"description": "I do stuff.",
"converted_from_user_script": true,
"version": "1.0",
"content_scripts": [ {
"all_frames" : true,
"exclude_globs": [ ],
"exclude_matches": [ ],
"include_globs": [ "http*://*.example.com/main.php*" ],
"js": [ "my_script_name.user.js" ],
"matches": [ "http://*.example.com/*", "https://*.example.com/*" ],
"run_at": "document_end"
} ]
}
Upvotes: 2