fhefh
V2EX  ›  编程

下载谷歌商店扩展的 js 代码

  •  
  •   fhefh · Apr 12, 2018 · 2754 views
    This topic created in 3015 days ago, the information mentioned may be changed or developed.

    代码如下:

    
    function n(e) {
        var o = document.createElement("a");
        if (o.href = e,
            "chrome.google.com" == o.host) {
            var n = o.pathname;
            "/" == n.slice(-1) && (n = n.slice(0, -1));
            var t = n.split("/");
            return t.pop()
        }
    }
    
    function t(e) {
        var o = "https://clients2.google.com/service/update2/crx?response=redirect&prodversion=49.0&x=id%3D***%26installsource%3Dondemand%26uc"
        , n = "***";
        return o.replace(n, e)
    }
    
    function get_crx_url(url) {
        return t(n(url));
    }
    
    //example
    //download Save to Pocket
    get_crx_url("https://chrome.google.com/webstore/detail/save-to-pocket/niloccemoadcdkdjlinkgdfekeahmflj");
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5071 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 01:10 · PVG 09:10 · LAX 18:10 · JFK 21:10
    ♥ Do have faith in what you're doing.