Last active
April 11, 2018 16:42
-
-
Save fhefh2015/00528a0e8b315436e3803469caa70e52 to your computer and use it in GitHub Desktop.
下载谷歌插件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment