我正在开发一个Firefox扩展,在网页的客户端我添加一个链接,并点击链接,我打算打开一个窗口,它将允许用户输入文本。当我点击链接时,它会打开窗口,但它不会让我写信给它。从Firefox的现有页面打开一个窗口给我安全错误
例如 ww.document.write('<div id = "textDiv">') ;
这给我一个错误:
Error: uncaught exception: [Exception... "Security error" code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location: "chrome://googbar/content/googbar.js Line: 272"]
,我使用下面的打开窗口:
var ww = Components.classes[
"@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher);
var wm =Components.classes["@mozilla.org/appshell/window-mediator;1"]
calWindow = ww.openWindow(null,'calendarWindow',null, 'left =500, top = 190, width = 230, height = 220,titlebar = no', null);
在打开的窗口没有一个空的窗口,它包含的内容父窗口。例如,我从维基百科打开此窗口,打开的新窗口包含维基页面。 任何人都可以帮助我吗?
与我的扩展我试着添加一个链接,点击打开一个窗口,在这个窗口中,用户可以输入将保存在SQLite中的文本。所以它就像允许用户在网页上注释一样。 – fftoolbar 2009-10-22 07:32:11
我甚至尝试过window.open,我认为它做同样的事情,但它给了我同样的错误。我正在讨论的这个链接被添加到客户端的网页上(而不是工具栏)。 – fftoolbar 2009-10-22 07:34:56