Search code examples
javascriptoperaopera-extension

Injected scripts in Opera extensions


I'm trying to "port" my Chrome-extension to Opera. My extension does nothing else but edits the DOM a little bit. In Chrome extension I use contentscript and based on my research the similar way for Opera is injected scripts. Anyway, the documentation doesn't really tell how should I use injected scripts.

I have the js-file in includes/ but seems like it doesn't include automatically. I also need to specify domains to inject the script on.

Currently my file has this content for testing purposes:

window.addEventListener('load', function() {
    alert('asd');
});

Any help is appreciated :)


Solution

  • Another resource you could read is the extension tutorial. However, looking at other extensions, I don't think you need to specify anything. Try putting a simple alert() in the script, or, even better, try inspecting the runtime with Dragonfly (Ctrl-Shift-I).

    Check that you have your config.xml and index.html in place.