开发者

open new window and write to it in developing firefox extension

开发者 https://www.devze.com 2023-01-10 09:43 出处:网络
I am developing Firefox extension that will extract bibliographic information from specific website , and when the user press a button on firefox\"the extension\" a new window should appear with the b

I am developing Firefox extension that will extract bibliographic information from specific website , and when the user press a button on firefox"the extension" a new window should appear with the bibliography data.

my problem is I opened a new window with JS and write to it with the normal JS code :

NewWin = window.open("", "NewWin", "toolbar=no,status=no,width=600,height=200");
NewWin.document.write("<b>Test</b>");  

but I've got an error

Error: uncaught exception: [Exception... "Security error"  code: "1000" nsresult: "0开发者_如何学Pythonx805303e8 (NS_ERROR_DOM_SECURITY_ERR)"  location: "chrome://custombutton/content/button.js Line: 5"]

any suggested solution on how to open a new window and to write to it a new information and to extract information from a document.

I have tested my code on bookmarklet , and when I wanted to converted to firefox extension I faced these problem.

this is my first time to develop an extension. so any help I really will appreciate it.

thank you.

0

精彩评论

暂无评论...
验证码 换一张
取 消