我安装了一个名为FireSSH的FF扩展,它基本上是Firefox中的一个终端。当它运行地址栏中的URL是chrome://firessh/content/firessh.xul - 我想在打开FireSSH的网页上建立一个链接,但到目前为止所有的尝试都失败了,例如我尝试过:
<script>
function myFunction()
{
window.open("chrome://firessh/content/firessh.xul");
}
</script>
<a href="#" onclick="myFunction()">firessh></a>
还有:
<a href="gBrowser.addTab("chrome://firessh/content/firessh.xul#account=Russell");">firessh</a>
简单地说:
<a href="chrome://firessh/content/firessh.xul#account=Russel">firessh</a>
任何帮助表示感谢。
乙
答案 0 :(得分:1)
收听所有页面,当您从插件中找到感兴趣的页面时,
var link = gBrowser.contentDocument.querySelector('#myLink');
link.addEventListener('click',openXulWindow,false);
//this openXulWindow opens a regular browser window
function openXulWindow() {
var sa = Cc["@mozilla.org/supports-array;1"].createInstance(Ci.nsISupportsArray);
var wuri = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
wuri.data = 'http://www.bing.com/';
let aCharset = 'UTF-8';
let charset = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
charset.data = "charset=" + aCharset;
var aAllowThirdPartyFixup = false;
var allowThirdPartyFixupSupports = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
allowThirdPartyFixupSupports.data = aAllowThirdPartyFixup;
sa.AppendElement(wuri);
sa.AppendElement(charset);
sa.AppendElement(allowThirdPartyFixupSupports);
let features = "chrome,dialog=no,all";
if (PrivateBrowsingUtils.permanentPrivateBrowsing) {
features += ",private";
} else {
features += ",non-private";
}
Services.ww.openWindow(null, 'chrome://browser/content/browser.xul', null, features, sa);
}
答案 1 :(得分:0)
由于安全问题,不允许网页内容访问,链接和/或编写chrome:
内容。 chrome:
以更高的安全级别运行,并且允许网络内容无限制调用进入chrome:
,这实质上是一个权限提升漏洞。