Reputation: 3782
This question is more for the benefit of others and my own curiosity, as I have synthesized a workaround for now (using "matches": ["http://*/*", "https://*/*"]
and if (location.hostname == "www.youtube.com")
.
Anyway, when I have an issue like this I break the code down into simpler and simpler forms until it starts to work. Then I can figure out what's tripping up the code. But I've hit that point now where it can't get simpler and it still doesn't work. Chrome just won't inject a content script into any of YouTube's pages.
Files (link to ZIP of the following)
manifest.json:
{
"name": "test",
"version": "0",
"manifest_version": 2,
"content_scripts": [
{
"js": [
"test.js"
],
"matches": [
"*://youtube.com/*"
],
"run_at": "document_end",
"all_frames": true
}
]
}
test.js:
alert("test");
Progress
Doesn't work:
matches
URLrun_at
all_frames
test.js
Does work:
matches
value to ANYTHING other than YouTubematches
value to "http://*/*", "https://*/*"
I feel like I'm missing something really obvious here, but it's been days.. ;/
Upvotes: 1
Views: 759
Reputation: 116
This works for me if you define the match in the manifest as "http://www.youtube.com/*"
Upvotes: 3