views:

25

answers:

1

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?

A: 

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.

Kinlan

related questions