KangoExtensions / kango

Kango framework issue tracker
74 stars 7 forks source link

Error in event handler for runtime.onMessage: ReferenceError: KangoAPI is not defined #123

Closed ghost closed 9 years ago

ghost commented 9 years ago

I know that it is not possible to open popup on context menu item click. But I want to show popup via javascript in the top right corner. So in context menu click I added: $(document.createElement('div')).load(kango.io.getResourceUrl('myPopup.html')).appendTo(document.body); And this code shows popup top right but I can't create any event handling in it. I want to make function in content.js that I can use like in popup example. But if I add < script type="text/javascript" src="kango-ui/kango_api.js" /> in "myPopup.html" I get error from the title. myPopup.html has the following structure:

`

` So what I should do to make this to work. Just a note to be able to load HTML like popup from html file I added this to extension_info: `"web_accessible_resources": [ "myPopup.html" ]` I have also tried to load popup.html (that work when load from browser button click) in iframe but all I get is popup.html loaded but can't make any event in it: `var url = kango.io.getResourceUrl('popup.html'); var frame = $("