Skip to content

Commit 06f146f

Browse files
committed
Skip pageAction on Firefox for Android
Fixes #67 again
1 parent 4d84dbb commit 06f146f

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

src/background.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,19 @@ function reformatForNAT64(addr, doLookup=true) {
143143
return formatIPv6(packed128, /*with_dots=*/isNAT64);
144144
}
145145

146-
// Magic object that calls action and/or pageAction. We want an icon in the
147-
// address bar when possible (e.g. desktop Firefox) but have a fallback option
148-
// when browsers forget to implement pageAction (e.g. Firefox 142 for Android).
146+
// Magic object that forwards calls to action and/or pageAction.
147+
// - Chrome: action only (pageAction not in manifest)
148+
// - Firefox mobile: action only (pageAction is broken on v142-143)
149+
// - Firefox desktop: action + pageAction (redundant icons)
150+
//
151+
// Originally, Firefox used pageAction only, until v142-143 broke it:
152+
// https://bugzilla.mozilla.org/show_bug.cgi?id=1984835
149153
const actions = new Proxy({}, {
150154
get(target, prop) {
151-
const apis = [chrome.action, chrome.pageAction].filter(Boolean);
155+
const apis = [chrome.action];
156+
if (chrome.pageAction && !IS_MOBILE) {
157+
apis.push(chrome.pageAction);
158+
}
152159
return (...args) => {
153160
for (const api of apis) {
154161
if (typeof api[prop] === 'function') {

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "IPvFoo",
33
"manifest_version": 3,
4-
"version": "2.25",
4+
"version": "2.26",
55
"description": "Display the server IP address, with a realtime summary of IPv4, IPv6, and HTTPS information across all page elements.",
66
"homepage_url": "https://github.com/pmarks-net/ipvfoo",
77
"icons": {

src/manifest/chrome-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "IPvFoo",
33
"manifest_version": 3,
4-
"version": "2.25",
4+
"version": "2.26",
55
"description": "Display the server IP address, with a realtime summary of IPv4, IPv6, and HTTPS information across all page elements.",
66
"homepage_url": "https://github.com/pmarks-net/ipvfoo",
77
"icons": {

src/manifest/firefox-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "IPvFoo",
33
"manifest_version": 3,
4-
"version": "2.25",
4+
"version": "2.26",
55
"description": "Display the server IP address, with a realtime summary of IPv4, IPv6, and HTTPS information across all page elements.",
66
"homepage_url": "https://github.com/pmarks-net/ipvfoo",
77
"icons": {

0 commit comments

Comments
 (0)