I am trying to make the simples chrome extension work in youtube (content script), but it doesn't seem to work correctly.
Oddly enough it works some of the times, and some it simple doesn't.
My final goal is to make it work only in the video URLs but I got stuck before that.
I originally tried:
"matches": [ "http://www.youtube.com/*" ]
Without any success at all, which I found odd, so I guess that's my first question, since in another extension I made, it worked perfectly for http://twitter.com/
I read the code to some youtube extensions, and one used:
"matches": [ "*://*.youtube.com/*" ]
The weird thing is that this only works sometimes, and I can't reproduce/understand when. It definitely not works when I reload the page, but in some URLs it just works.
The actual script is bare bones script for debugging:
$(window).load(function() {
alert(2);
});
So I'm pretty confused about this inconsistent behaviour.
Edit:
This url's don's seem to work:
This do:
Edit 2:
Entire manifest:
{
"name": "__MSG_extname__",
"version": "0.1",
"default_locale": "en",
"manifest_version": 2,
"icons": {
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png" },
"content_scripts":[
{
"matches": [ "*://*.youtube.com/*" ],
"js": ["jquery.min.js", "script.js"]
}
],
"web_accessible_resources": ["images/down-arrow.png"]
}