Skip to content

Commit e96b362

Browse files
committed
fix webstore integration failing if navigating from a non-extension webstore page
1 parent 26ecd83 commit e96b362

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

Chromium Web Store.crx

8 Bytes
Binary file not shown.

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "__MSG_extension_Name__",
55
"description": "__MSG_extension_Description__",
66
"default_locale": "en",
7-
"version": "1.5.4.3",
7+
"version": "1.5.5",
88
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqF/d41Q7agjkUzYq8ZGbQr8XW8mmEIMXOnR1uCTnYLL+Dm9Z+LO50xZukOISNy6zFxpI8ts/OGLsm+I2x9+UprUU4/EVdmxuwegFE6NBoEhHoRNYY0gbXZkaU8YY/XwzjVY/k18DDhl5NYPEnF6uq4Oyidg+xtd3W4+iGYczuOLER1Tp5y614zOTphcvFYhvUkCijQ6HT1TtRq/34SlFoRQqo4SFiLriK451xWIcfwiMLIekWrdoQa1v8dqIlMA3r6CKc0QykJpSYbiyormWiZ0hl2HLpkZ85mD9V0eDQ5RCtb6vkybK7INcq4yKQV4YkXhr9NpX9U4re4dlFQjEJQIDAQAB",
99
"permissions": [
1010
"management",

src/scripts/background.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,12 @@ chrome.runtime.onMessageExternal.addListener(function (
283283
});
284284
break;
285285
case "getAll":
286-
var [id, ..._] = request.args;
286+
var [href, ..._] = request.args;
287+
const target_ext = ncws_re.exec(href)?.[1];
287288
chrome.management.getAll((exts) => {
288289
// instead of exposing entire extension list, filter to only the relevant extension.
289290
sendResponse({
290-
args: [exts.filter((extInfo) => extInfo.id === id)],
291+
args: [exts.filter((extInfo) => extInfo.id === target_ext)],
291292
});
292293
});
293294
break;

src/scripts/chromeApi.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/extensions/api/webstore_private.json
22
const ncws_re = /.*detail(?:\/[^\/]+)?\/([a-z]{32})/i; // copied from util.js since it's out of context
3-
const THIS_EXT_ID = ncws_re.exec(window.location.href)[1];
43
const EXT_ID = document.currentScript.getAttribute("extension_id");
54
const port = chrome.runtime.connect(EXT_ID, { name: "windowchromeport" });
65
const CALLBACKS = [];
@@ -68,7 +67,7 @@ window.chrome.management = {
6867
getAll: function (cb) {
6968
chrome.runtime.sendMessage(
7069
EXT_ID,
71-
{ func: "getAll", args: [THIS_EXT_ID] },
70+
{ func: "getAll", args: [window.location.href] },
7271
(resp) => {
7372
resp.args && cb(...resp.args);
7473
},

updates.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
33
<app appid='ocaahdebbfolfmndjeplogmgcagdmblk'>
4-
<updatecheck codebase='https://github.com/NeverDecaf/chromium-web-store/releases/latest/download/Chromium.Web.Store.crx' version='1.5.4.3' status='ok' />
4+
<updatecheck codebase='https://github.com/NeverDecaf/chromium-web-store/releases/latest/download/Chromium.Web.Store.crx' version='1.5.5' status='ok' />
55
</app>
66
</gupdate>

0 commit comments

Comments
 (0)