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

Function handleContextClick

src/scripts/background.js:6–31  ·  view source on GitHub ↗
(info, tab)

Source from the content-addressed store, hash-verified

4const tabsAwaitingInstall = new Set();
5const extensionsTabId = {};
6function handleContextClick(info, tab) {
7 if (info.menuItemId == "updateAll")
8 checkForUpdates(function (
9 updateCheck,
10 installed_versions,
11 appid,
12 updatever,
13 is_webstore,
14 ) {
15 let crx_url = updateCheck["@codebase"];
16 promptInstall(crx_url, is_webstore, WEBSTORE.chrome, msgHandler);
17 });
18 else if (info.menuItemId == "installExt") {
19 let store = WEBSTORE.chrome;
20 [...WEBSTORE_MAP.keys()].some((k) => {
21 if (k.test(tab.url)) {
22 store = WEBSTORE_MAP.get(k);
23 return true;
24 }
25 });
26 promptInstall(buildExtensionUrl(tab.url), true, store, msgHandler);
27 } else if (info.menuItemId == "cws")
28 chrome.tabs.create({
29 url: "https://chrome.google.com/webstore/",
30 });
31}
32
33function updateBadge(modified_ext_id = null) {
34 checkForUpdates();

Callers

nothing calls this directly

Calls 3

checkForUpdatesFunction · 0.70
promptInstallFunction · 0.70
buildExtensionUrlFunction · 0.70

Tested by

no test coverage detected