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 = $("
Also just to note if I try to load popup.html from example in the same way I get 404 for each resource.Like: GET http://kangoextensions.com/docs/general/kango-ui/kango_api.js?_=1432646885846 404 (Not Found)
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:`
Also just to note if I try to load popup.html from example in the same way I get 404 for each resource.Like:
GET http://kangoextensions.com/docs/general/kango-ui/kango_api.js?_=1432646885846 404 (Not Found)
There is no way to open popup programmatically or add it to web page. If you want to open a page from extension resources, you can create
Options page
and usekango.ui.optionsPage.open
http://kangoextensions.com/docs/api-reference/kango-ui-optionsPage.html.Or you can create you HTML dynamically from content script using
document.createElement('div')
and useContent scripts API
, notkango_api.js
.