MCPcopy
hub / github.com/NeverDecaf/chromium-web-store / buildExtensionUrl

Function buildExtensionUrl

src/scripts/util.js:74–99  ·  view source on GitHub ↗
(href, extensionId = undefined)

Source from the content-addressed store, hash-verified

72}
73
74function buildExtensionUrl(href, extensionId = undefined) {
75 extensionId = extensionId || getExtensionId(href);
76 if (extensionId == undefined) return;
77 if (is_cws.test(href) || is_ncws.test(href)) {
78 var chromeVersion = /Chrome\/([0-9.]+)/.exec(navigator.userAgent)[1];
79 return (
80 "https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=" +
81 chromeVersion +
82 "&x=id%3D" +
83 extensionId +
84 "%26installsource%3Dondemand%26uc"
85 );
86 }
87 if (is_ows.test(href)) {
88 return (
89 "https://addons.opera.com/extensions/download/" + extensionId + "/"
90 );
91 }
92 if (is_ews.test(href)) {
93 return (
94 "https://edge.microsoft.com/extensionwebstorebase/v1/crx?response=redirect&x=id%3D" +
95 extensionId +
96 "%26installsource%3Dondemand%26uc"
97 );
98 }
99}
100
101function promptInstall(
102 crx_url,

Callers 5

handleContextClickFunction · 0.70
background.jsFile · 0.70
createButtonFunction · 0.70
modifyNewCWSButtonFunction · 0.70
inject.jsFile · 0.70

Calls 1

getExtensionIdFunction · 0.70

Tested by

no test coverage detected