Reputation: 16126
I'm trying to create an extension using this docs: http://code.google.com/chrome/extensions/content_scripts.html
I want a part of JS code to run when document is ready (loaded).
This is my manifest.json:
{
"name": "OwnExtension",
"version": "0.1",
"content_scripts": [
{
"matches": ["https://my.site.eu/*"],
"css": ["styles.css"],
"js": ["main.js"]
}
]
}
This is my main.js:
alert(10);
Am I doing sth wrong, that nothing happend when page https://my.site.eu/ loaded in browser?
Upvotes: 1
Views: 1036
Reputation: 16597
alert() doesn't work from a content script.
Try console.log("hello") and you should see it in the developer panel when you view your extension in debug mode.
Upvotes: 2