Closed martinth closed 11 years ago
Opera has several issues with variables visibility scope in content scripts (we have reported to Opera developers about a year ago but no changes).
Change library declaration to:
var rangy;
rangy = window.rangy = function(){/*...*/}
then in content script you can use rangy variable:
kango.console.log(typeof rangy); // object
I'm developing a extension that uses rangy (https://code.google.com/p/rangy/) in a contentscript. When I install this extension in Opera I get the following error when the contentscript starts to run:
I suspect that this is somehow related to issue #33 since I had an similiar error with jQuery (that was gone when I used the quick fix posted there).
Steps to reproduce
// @require rangy-core.js
on top of it and any code (i.e.alert("Foo");
in itWhat I've tried
When I look at the rangy-cory.js they are using something like
for there core. I have already tried changing this to:
This however doesn't change anything. Additionally I would rathe not like to change the library I'm using. Is there a way to fix this in kango?