您好,您可以试试下面这个手势脚本,其中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);}