This commit is contained in:
parent
3006da5319
commit
fdfc5c63df
5 changed files with 17 additions and 5 deletions
12
common.js
12
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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<link rel="stylesheet" href="index.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<div id="list" data-loading=true>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* globals UAParser */
|
||||
'use strict';
|
||||
|
||||
document.body.dataset.android = navigator.userAgent.indexOf('Android') !== -1;
|
||||
|
||||
var json = [];
|
||||
|
||||
function filter(list) {
|
||||
|
|
|
@ -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",
|
||||
|
||||
|
|
Loading…
Reference in a new issue