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);
|
ts.forEach(t => tabs[t.id] = t.windowId);
|
||||||
ua.update();
|
ua.update();
|
||||||
});
|
});
|
||||||
chrome.browserAction.setBadgeBackgroundColor({
|
if (chrome.browserAction.setBadgeBackgroundColor) { // FF for Android
|
||||||
color: prefs.color
|
chrome.browserAction.setBadgeBackgroundColor({
|
||||||
});
|
color: prefs.color
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
chrome.storage.onChanged.addListener(ps => {
|
chrome.storage.onChanged.addListener(ps => {
|
||||||
Object.keys(ps).forEach(key => prefs[key] = ps[key].newValue);
|
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
|
// 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) {
|
function hostname(url) {
|
||||||
const s = url.indexOf('//') + 2;
|
const s = url.indexOf('//') + 2;
|
||||||
|
|
|
@ -181,3 +181,8 @@ select {
|
||||||
#explore:not([data-loaded="true"]) {
|
#explore:not([data-loaded="true"]) {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body[data-android="true"] [data-cmd="reload"],
|
||||||
|
body[data-android="true"] [data-cmd="window"] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
<link rel="stylesheet" href="index.css">
|
<link rel="stylesheet" href="index.css">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="list" data-loading=true>
|
<div id="list" data-loading=true>
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
/* globals UAParser */
|
/* globals UAParser */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
document.body.dataset.android = navigator.userAgent.indexOf('Android') !== -1;
|
||||||
|
|
||||||
var json = [];
|
var json = [];
|
||||||
|
|
||||||
function filter(list) {
|
function filter(list) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "User-Agent Switcher and Manager",
|
"name": "User-Agent Switcher and Manager",
|
||||||
"short_name": "useragent-switcher",
|
"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",
|
"description": "Spoofs User-Agent strings of your browser with a new one globally, randomly or per hostname",
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue