打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
用其他浏览器打开当前链接- Open URL With.uc.js
自己修改,用ie和chrome,打开,作改时地址改成\\
、、、、、、、、、、、、、、、、、

/* Open URL With
* nanto_vi (TOYAMA Nao), 2006-12-26
*
* Open an application with the current page's URL.
*/

(function OpenURLWith() {
    
    const MENU_LABEL = "Open With";
    const MENU_ACCESSKEY = "O";
    
    const IE_PATH = "C:\\Program Files\\Internet Explorer\\iexplore.exe";
    const chrome_PATH = "C:\\Documents and Settings\\Administrator\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe";
    
    var mMenus = [
        {
            label: "Internet Explorer(link)",
            accesskey: "L",
            application: IE_PATH,
            get url() { return gContextMenu.linkURL; },
            get shouldDisplay() { return gContextMenu.onLink; }
        },
        {
            label: " chrome (link)",
            accesskey: "N",
            application: chrome_PATH,
            get url() { return gContextMenu.linkURL; },
            get shouldDisplay() { return gContextMenu.onLink; }
        },
        {
            label: "-",
            get shouldDisplay() { return gContextMenu.onLink; }
        },
        {
            label: "Internet Explorer(page)",
            accesskey: "I",
            application: IE_PATH,
            get url() { return content.location.href; },
        },
        {
            label: " chrome(page)",
            accesskey: "O",
            application: chrome_PATH,
            get url() { return content.location.href; },
        },
        {
            label: "-",
            get shouldDisplay() { return gContextMenu.inFrame; }
        },
        {
            label: "Internet Explorer",
            accesskey: "F",
            application: IE_PATH,
            get url() { return document.commandDispatcher.focusedWindow.location.href; },
            get shouldDisplay() { return gContextMenu.inFrame; }
        },
        {
            label: " chrome",
            accesskey: "R",
            application: chrome_PATH,
            get url() { return document.commandDispatcher.focusedWindow.location.href; },
            get shouldDisplay() { return gContextMenu.inFrame; }
        }
    ];
    
    init: {
        let parentMenu = document.createElement("menu");
        parentMenu.setAttribute("label", MENU_LABEL);
        if (typeof MENU_ACCESSKEY != "undefined" && MENU_ACCESSKEY)
            parentMenu.setAttribute("accesskey", MENU_ACCESSKEY);
        document.getElementById("contentAreaContextMenu").insertBefore(
            parentMenu, document.getElementById("context-sep-properties"));
        
        let parentPopup = document.createElement("menupopup");
        parentPopup.id = "openurlwith-popup";
        parentPopup.addEventListener("command", openApplication, false);
        parentMenu.appendChild(parentPopup);
        
        for (let i = 0, menu; menu = mMenus[i]; i++) {
            let menuItem;
            if (menu.label == "-") {
                menuItem = document.createElement("menuseparator");
            } else {
            menuItem = document.createElement("menuitem");
            menuItem.setAttribute("label", menu.label);
            if ("accesskey" in menu)
                menuItem.setAttribute("accesskey", menu.accesskey);
            menuItem.ouwMenu = menu;
        }
        parentPopup.appendChild(menuItem);
    }
    
    parentMenu.parentNode.addEventListener("popupshowing", setMenuDisplay, false);
}

function openApplication(aEvent) {
    var menu = aEvent.target.ouwMenu;
    
    var app = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
    app.initWithPath(menu.application);
    if (!app.exists()) {
        alert("File doesn't exist: " + menu.application);
        return;
    }
    
    Cc["@mozilla.org/browser/shell-service;1"]
    .getService(Ci.nsIShellService_MOZILLA_1_8_BRANCH || Ci.nsIShellService)
    .openApplicationWithURI(app, menu.url);
}

function setMenuDisplay() {
    var menuItems = document.getElementById("openurlwith-popup").childNodes;
    for (var i = 0, menu; menu = mMenus[i]; i++)
        menuItems[i].hidden = "shouldDisplay" in menu && !menu.shouldDisplay;
}

})();

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
flex自定义右键菜单
打造超酷网页右键菜单二法
Desktop Visualizer
label标签的使用-asp教程
!!!!! .kmm Greasify 0.7.9.5.1rc Module for K-Meleon v1.5, 1.6, 1.7 series (updated Jan. 24, 2011)
eureka 迁移 k8s 集群
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服