有時候需要快速在chrome中打開當前頁面
火狐安装 firegestures扩展
选项-映射-添加脚本
const CHROME_PATH = "D://Programs//Chrome//chrome.exe"; //chrome.exe的路径 记得转义"/"
var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
file.initWithPath(CHROME_PATH);
if (!file.exists()) {
alert("File does not exist:" + CHROME_PATH);
return;
}
var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
try {
var args = [window.content.location.href];
process.init(file);
process.run(false, args, args.length);
}
catch (ex) {
alert("Failed to execute:" + CHROME_PATH);
}
效果