diff --git a/common.js b/common.js index f7aabb7..e9e5583 100644 --- a/common.js +++ b/common.js @@ -21,9 +21,11 @@ chrome.storage.local.get(prefs, ps => { ts.forEach(t => tabs[t.id] = t.windowId); ua.update(); }); - chrome.browserAction.setBadgeBackgroundColor({ - color: prefs.color - }); + if (chrome.browserAction.setBadgeBackgroundColor) { // FF for Android + chrome.browserAction.setBadgeBackgroundColor({ + color: prefs.color + }); + } }); chrome.storage.onChanged.addListener(ps => { Object.keys(ps).forEach(key => prefs[key] = ps[key].newValue); @@ -127,7 +129,9 @@ User-Agent String: ${prefs.mode === 'custom' ? custom : str || navigator.userAge } }; // make sure to clean on window removal -chrome.windows.onRemoved.addListener(windowId => delete ua._obj[windowId]); +if (chrome.windows) { // FF on Android + chrome.windows.onRemoved.addListener(windowId => delete ua._obj[windowId]); +} function hostname(url) { const s = url.indexOf('//') + 2; diff --git a/data/popup/index.css b/data/popup/index.css index 0019eb4..a8d1597 100644 --- a/data/popup/index.css +++ b/data/popup/index.css @@ -181,3 +181,8 @@ select { #explore:not([data-loaded="true"]) { height: 16px; } + +body[data-android="true"] [data-cmd="reload"], +body[data-android="true"] [data-cmd="window"] { + display: none; +} diff --git a/data/popup/index.html b/data/popup/index.html index eae5093..b7d40ab 100644 --- a/data/popup/index.html +++ b/data/popup/index.html @@ -3,6 +3,7 @@ +
diff --git a/data/popup/index.js b/data/popup/index.js index 152d507..7c5c72f 100644 --- a/data/popup/index.js +++ b/data/popup/index.js @@ -1,6 +1,8 @@ /* globals UAParser */ 'use strict'; +document.body.dataset.android = navigator.userAgent.indexOf('Android') !== -1; + var json = []; function filter(list) { diff --git a/manifest.json b/manifest.json index 1fd51fa..1510e0d 100755 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "User-Agent Switcher and Manager", "short_name": "useragent-switcher", - "version": "0.2.4", + "version": "0.2.5", "description": "Spoofs User-Agent strings of your browser with a new one globally, randomly or per hostname",