怎么用firegestrues在火狐中调出chrome,类似用ie tab调出lie的效果

打错了,类似用ie tab调出ie的效果
2024-12-28 17:53:05
推荐回答(1个)
回答1:

您好,您可以试试下面这个手势脚本,其中X:\\xxx\\chrome.exe是路径名,自行修改为chrome的路径就行

const APP_
PATH ="X:\\xxx\\chrome.exe";

var srcNode = FireGestures.sourceNode;
var linkURL = gBrowser.currentURI.spec;

if (!linkURL)
throw "Not on a link";

var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
file.initWithPath(APP_PATH);
if (!file.exists()){
alert("File does not exist:" + APP_PATH);
return;
}
var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
try {
var args =[linkURL];
process.init(file);
process.run(false, args, args.length);

//关闭Firefox当前标签
BrowserCloseTabOrWindow();
}
catch (ex) {
alert("Failed to execute:" + APP_PATH);}