fixes #36, fixes #37

This commit is contained in:
Ray Lothian 2019-05-16 07:18:58 +02:00
parent e1cdd7cb44
commit 6a5c4c4783
12 changed files with 35 additions and 15 deletions

View file

@ -234,7 +234,7 @@ function match({url, tabId}) {
if (prefs.custom[key]) {
prefs.custom[key] = s;
}
else {
else if (prefs.custom['*']) {
prefs.custom['*'] = s;
}
}

View file

@ -55,10 +55,12 @@ input {
input[type=button] {
cursor: pointer;
min-width: 100px;
transition-delay: 0;
}
input[type=button]:active {
input[type=button].active {
opacity: 0.5;
}
input[type=button]:disabled {
opacity: 0.2;
cursor: default;
@ -158,17 +160,19 @@ select {
display: none;
}
[data-cmd="refresh"] {
margin-left: 2px;
[data-cmd] {
margin-right: 2px;
}
[data-cmd="test"] {
background-color: #4d72b7;
border: solid 1px #4a6dad;
color: #fff;
}
[data-cmd="window"],
[data-cmd="apply"] {
color: #fff;
background-color: #3c923c;
border: solid 1px #327932;
margin-right: 2px;
margin-left: 2px;
}
[data-cmd="reset"] {

View file

@ -25,6 +25,7 @@
<option value="Firefox">Firefox</option>
<option value="Opera">Opera</option>
<option value="Edge">Edge</option>
<option value="Vivaldi">Vivaldi</option>
</optgroup>
<optgroup label="Others"></optgroup>
</select>&nbsp;
@ -73,7 +74,8 @@
<span flex="1"></span>
<input type="button" value="Apply" title="Set this string as the browser's User-Agent string" data-cmd="apply">
<input type="button" value="Window" title="Set this string as this window's User-Agent string" data-cmd="window">
<input type="button" value="Reset" title="Reset User-Agent string to the default one. This will not reset window-based UA strings. To reset them, use the 'Restart' button" style="margin-left: 2px;" data-cmd="reset">
<input type="button" value="Reset" title="Reset User-Agent string to the default one. This will not reset window-based UA strings. To reset them, use the 'Restart' button" data-cmd="reset">
<input type="button" value="Test" title="Test your user-agent string" data-cmd="test">
</div>
<input id="ua" type="text" placeholder="Your preferred user-agent string" title="To set blank user-agent string, use 'empty' keyword">
<div id="explore"></div>

View file

@ -189,6 +189,18 @@ document.addEventListener('click', ({target}) => {
else if (cmd === 'reload') {
chrome.runtime.reload();
}
else if (cmd === 'test') {
chrome.storage.local.get({
'test': 'https://webbrowsertools.com/useragent/?method=normal&verbose=false'
}, prefs => chrome.tabs.create({
url: prefs.test
}));
}
if (cmd) {
target.classList.add('active');
window.setTimeout(() => target.classList.remove('active'), 500);
}
}
});

View file

@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "User-Agent Switcher and Manager",
"short_name": "useragent-switcher",
"version": "0.2.8",
"version": "0.2.9",
"description": "Spoofs User-Agent strings of your browser with a new one globally, randomly or per hostname",
@ -43,7 +43,7 @@
},
"default_popup": "data/popup/index.html"
},
"homepage_url": "http://add0n.com/useragent-switcher.html",
"homepage_url": "https://add0n.com/useragent-switcher.html",
"options_ui": {
"page": "data/options/index.html",
"chrome_style": true

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -28,7 +28,8 @@ fs.readdir('./browsers/', async (err, files) => {
const list = [
...require('./list-1.json'),
...require('./list-2.json'),
...require('./list-3.json')
...require('./list-3.json'),
...require('./list-4.json')
].filter((s, i, l) => l.indexOf(s) === i);
for (const ua of list) {
parser.setUA(ua);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
node/list-4.json Normal file
View file

@ -0,0 +1 @@
["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…hrome/40.0.2214.89 Safari/537.36 Vivaldi/1.0.94.1", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…ome/45.0.2454.99 Safari/537.36 Vivaldi/1.0.303.27", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…me/50.0.2661.102 Safari/537.36 Vivaldi/1.1.453.59", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…me/51.0.2704.103 Safari/537.36 Vivaldi/1.2.490.43", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…me/52.0.2743.117 Safari/537.36 Vivaldi/1.3.551.30", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…me/53.0.2785.148 Safari/537.36 Vivaldi/1.4.589.38", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…me/54.0.2840.100 Safari/537.36 Vivaldi/1.5.658.56", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…ome/55.0.2883.98 Safari/537.36 Vivaldi/1.6.689.46", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…ome/56.0.2924.88 Safari/537.36 Vivaldi/1.7.735.46", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…me/57.0.2987.111 Safari/537.36 Vivaldi/1.8.770.50", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…ome/58.0.3029.97 Safari/537.36 Vivaldi/1.9.818.49", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…me/58.0.3029.114 Safari/537.36 Vivaldi/1.10.845.3", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…e/59.0.3071.112 Safari/537.36 Vivaldi/1.91.867.48", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…/65.0.3325.183 Safari/537.36 Vivaldi/1.96.1147.64", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…e/69.0.3497.102 Safari/537.36 Vivaldi/2.0.1309.42", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…e/70.0.3538.113 Safari/537.36 Vivaldi/2.1.1337.51", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…me/71.0.3578.98 Safari/537.36 Vivaldi/2.2.1388.37", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…e/72.0.3626.122 Safari/537.36 Vivaldi/2.3.1440.60", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…e/73.0.3683.105 Safari/537.36 Vivaldi/2.4.1488.40", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36…e/74.0.3729.134 Safari/537.36 Vivaldi/2.5.1525.40", "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20070601 Firefox/1.5.0.12", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070601 Firefox/1.5.0.12", "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.19) Gecko/20081216 Firefox/2.0.0.19", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20081216 Firefox/2.0.0.19", "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021501 Firefox/3.0.18", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.18) Gecko/2010021501 Firefox/3.0.18", "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.2pre) Gecko/20090729 Firefox/3.5.1", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2pre) Gecko/20090729 Firefox/3.5.1", "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.1) Gecko/20100122 Firefox/3.6.1", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.1) Gecko/20100122 Firefox/3.6.1", "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110830 Firefox/3.6.21", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.21) Gecko/20110830 Firefox/3.6.21", "Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1", "Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1", "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1", "Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20100101 Firefox/15.0.1", "Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0", "Mozilla/5.0 (X11; Linux i686; rv:21.0) Gecko/20100101 Firefox/21.0", "Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0", "Mozilla/5.0 (X11; Linux i686; rv:30.0) Gecko/20100101 Firefox/30.0", "Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0", "Mozilla/5.0 (X11; Linux i686; rv:40.0) Gecko/20100101 Firefox/40.0", "Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0", "Mozilla/5.0 (X11; Linux i686; rv:56.0) Gecko/20100101 Firefox/56.0", "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0", "Mozilla/5.0 (X11; Linux i686; rv:57.0) Gecko/20100101 Firefox/57.0", "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0", "Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Firefox/60.0", "Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0", "Mozilla/5.0 (X11; Linux i686; rv:66.0) Gecko/20100101 Firefox/66.0", "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0", "Mozilla/5.0 (X11; Linux i686; rv:67.0) Gecko/20100101 Firefox/67.0"]

View file

@ -1 +1 @@
{"Opera":{"Mac OS":true,"Windows":true,"Android":true,"Symbian":true,"Linux":true,"Ubuntu":true,"Debian":true,"Mint":true,"FreeBSD":true,"Nintendo":true,"OpenSolaris":true,"Solaris":true,"OpenBSD":true,"kubuntu":true,"UNIX":true},"Firefox":{"Mac OS":true,"Windows":true,"Android":true,"iOS":true,"Ubuntu":true,"Linux":true,"Fedora":true,"OpenBSD":true,"NetBSD":true,"Mageia":true,"FreeBSD":true,"Gentoo":true,"SUSE":true,"CentOS":true,"Slackware":true,"Mint":true,"DragonFly":true,"Solaris":true,"Kubuntu":true,"Mandriva":true,"BeOS":true,"Debian":true},"Chrome":{"Mac OS":true,"Windows":true,"Android":true,"Linux":true,"OpenBSD":true,"Chromium OS":true,"NetBSD":true,"FreeBSD":true,"Slackware":true,"SUSE":true,"Ubuntu":true,"Debian":true,"iOS":true,"Fedora":true},"IE":{"Windows":true,"Mac OS":true,"Solaris":true,"Linux":true,"Unix":true},"Mobile Safari":{"iOS":true,"BlackBerry":true,"Windows":true},"IEMobile":{"Windows Phone":true,"Windows Phone OS":true,"Windows":true},"Safari":{"Mac OS":true,"Android":true,"Symbian":true,"Windows":true,"Linux":true},"Android Browser":{"Android":true,"Windows":true},"Opera Mobi":{"Android":true,"Symbian":true,"Windows":true,"Mac OS":true,"Linux":true},"Opera Mini":{"iOS":true,"Symbian":true,"BlackBerry":true,"Android":true,"Windows":true,"Mac OS":true,"Linux":true,"UNIX":true},"UCBrowser":{"Android":true,"Windows":true},"Puffin":{"Android":true},"Samsung Browser":{"Android":true},"Yandex":{"Android":true,"Windows":true},"MIUI Browser":{"Android":true},"Edge":{"Windows Phone":true,"Windows":true},"WebKit":{"BlackBerry":true,"Symbian":true,"Mac OS":true,"Windows":true,"Linux":true},"Blazer":{"Windows":true},"BOLT":{"Windows":true},"Webkit":{"Symbian":true,"Linux":true},"Fennec":{"Android":true,"Windows":true,"Linux":true,"Mac OS":true},"GoBrowser":{"Android":true},"Maemo Browser":{"Linux":true},"Minimo":{"Linux":true,"Windows":true,"OpenBSD":true},"Kindle":{"Linux":true},"Opera Mi":{"Windows":true},"Skyfire":{"Mac OS":true},"Chromium":{"Ubuntu":true,"Linux":true},"Avant ":{"Windows":true},"Maxthon":{"Windows":true},"Arora":{"Linux":true,"Windows":true},"Mozilla":{"Windows":true,"Debian":true,"Linux":true,"Ubuntu":true,"Mac OS":true,"OpenBSD":true,"BeOS":true,"Haiku":true,"Solaris":true,"SUSE":true,"Fedora":true,"Gentoo":true,"Slackware":true,"Mint":true,"Mandriva":true,"Kubuntu":true,"CentOS":true,"FreeBSD":true,"Zenwalk":true,"ubuntu":true,"OS/2":true,"AIX":true,"QNX":true,"NetBSD":true,"Android":true},"Epiphany":{"Linux":true,"Ubuntu":true,"OpenBSD":true,"FreeBSD":true,"SUSE":true,"Fedora":true,"Debian":true,"Gentoo":true,"Solaris":true},"Camino":{"Mac OS":true},"Chimera":{"Mac OS":true},"Comodo Dragon":{"Windows":true,"Linux":true},"conkeror":{"Debian":true,"Windows":true,"Linux":true},"Conkeror":{"Debian":true},"Links":{"Linux":true,"NetBSD":true,"gentoo":true,"Unix":true,"OpenBSD":true,"FreeBSD":true,"Mac OS":true,"Solaris":true,"Debian":true},"links":{"Linux":true},"Firebird":{"Windows":true,"Mac OS":true,"Solaris":true,"Linux":true},"firefox":{"Linux":true},"Swiftfox":{"Linux":true},"Netscape":{"Windows":true,"Mac OS":true,"Linux":true,"Solaris":true,"AIX":true},"Flock":{"Mac OS":true,"Windows":true,"Linux":true},"iCab":{"Mac OS":true,"Windows":true},"Iceape":{"Linux":true},"icecat":{"Linux":true},"IceCat":{"Linux":true},"Iceweasel":{"Linux":true,"Debian":true,"debian":true,"Gentoo":true,"Ubuntu":true},"IceWeasel":{"Ubuntu":true,"Debian":true,"Windows":true},"iceweasel":{"Debian":true},"Iron":{"Windows":true,"Linux":true,"Mac OS":true},"K-Meleon":{"Windows":true,"Linux":true,"FreeBSD":true},"Konqueror":{"Linux":true,"FreeBSD":true,"Fedora":true,"Kubuntu":true,"Slackware":true,"OpenBSD":true,"DragonFly":true,"Windows":true,"Solaris":true,"NetBSD":true,"SUSE":true,"Debian":true},"Lunascape":{"Windows":true},"Lynx":{"GNU":true},"MAXTHON":{"Windows":true},"midori":{"Linux":true},"Midori":{"Linux":true,"FreeBSD":true,"Windows":true},"KHTML":{"Windows":true},"Mosaic":{"Windows":true,"AIX":true,"Solaris":true},"NetSurf":{"RISC OS":true,"Linux":true,"NetBSD":true},"OmniWeb":{"Mac OS":true},"Opera Tablet":{"Windows":true,"Symbian":true},"PaleMoon":{"Windows":true},"Palemoon":{"Windows":true},"Phoenix":{"Linux":true,"Windows":true,"Mac OS":true},"RockMelt":{"Windows":true,"Mac OS":true},"SeaMonkey":{"Windows":true,"Linux":true,"OS/2":true,"Mac OS":true,"FreeBSD":true,"OpenBSD":true,"Fedora":true,"SUSE":true,"Mandriva":true,"Gentoo":true,"BeOS":true,"Haiku":true,"AmigaOS":true,"CentOS":true},"Seamonkey":{"Windows":true,"Linux":true},"Slim":{"Windows":true},"w3m":{"Debian":true},"IceDragon":{"Windows":true},"Waterfox":{"Windows":true,"Linux":true},"GSA":{"iOS":true},"Vivaldi":{"Windows":true,"Linux":true},"Facebook":{"iOS":true,"Android":true},"Chrome WebView":{"Android":true},"QQBrowser":{"Windows":true},"Iridium":{"Windows":true},"Basilisk":{"Windows":true}}
{"Opera":{"Mac OS":true,"Windows":true,"Android":true,"Symbian":true,"Linux":true,"Ubuntu":true,"Debian":true,"Mint":true,"FreeBSD":true,"Nintendo":true,"OpenSolaris":true,"Solaris":true,"OpenBSD":true,"kubuntu":true,"UNIX":true},"Firefox":{"Mac OS":true,"Windows":true,"Android":true,"iOS":true,"Ubuntu":true,"Linux":true,"Fedora":true,"OpenBSD":true,"NetBSD":true,"Mageia":true,"FreeBSD":true,"Gentoo":true,"SUSE":true,"CentOS":true,"Slackware":true,"Mint":true,"DragonFly":true,"Solaris":true,"Kubuntu":true,"Mandriva":true,"BeOS":true,"Debian":true},"Chrome":{"Mac OS":true,"Windows":true,"Android":true,"Linux":true,"OpenBSD":true,"Chromium OS":true,"NetBSD":true,"FreeBSD":true,"Slackware":true,"SUSE":true,"Ubuntu":true,"Debian":true,"iOS":true,"Fedora":true},"IE":{"Windows":true,"Mac OS":true,"Solaris":true,"Linux":true,"Unix":true},"Mobile Safari":{"iOS":true,"BlackBerry":true,"Windows":true},"IEMobile":{"Windows Phone":true,"Windows Phone OS":true,"Windows":true},"Safari":{"Mac OS":true,"Android":true,"Symbian":true,"Windows":true,"Linux":true},"Android Browser":{"Android":true,"Windows":true},"Opera Mobi":{"Android":true,"Symbian":true,"Windows":true,"Mac OS":true,"Linux":true},"Opera Mini":{"iOS":true,"Symbian":true,"BlackBerry":true,"Android":true,"Windows":true,"Mac OS":true,"Linux":true,"UNIX":true},"UCBrowser":{"Android":true,"Windows":true},"Puffin":{"Android":true},"Samsung Browser":{"Android":true},"Yandex":{"Android":true,"Windows":true},"MIUI Browser":{"Android":true},"Edge":{"Windows Phone":true,"Windows":true},"WebKit":{"BlackBerry":true,"Symbian":true,"Mac OS":true,"Windows":true,"Linux":true},"Blazer":{"Windows":true},"BOLT":{"Windows":true},"Webkit":{"Symbian":true,"Linux":true},"Fennec":{"Android":true,"Windows":true,"Linux":true,"Mac OS":true},"GoBrowser":{"Android":true},"Maemo Browser":{"Linux":true},"Minimo":{"Linux":true,"Windows":true,"OpenBSD":true},"Kindle":{"Linux":true},"Opera Mi":{"Windows":true},"Skyfire":{"Mac OS":true},"Chromium":{"Ubuntu":true,"Linux":true},"Avant ":{"Windows":true},"Maxthon":{"Windows":true},"Arora":{"Linux":true,"Windows":true},"Mozilla":{"Windows":true,"Debian":true,"Linux":true,"Ubuntu":true,"Mac OS":true,"OpenBSD":true,"BeOS":true,"Haiku":true,"Solaris":true,"SUSE":true,"Fedora":true,"Gentoo":true,"Slackware":true,"Mint":true,"Mandriva":true,"Kubuntu":true,"CentOS":true,"FreeBSD":true,"Zenwalk":true,"ubuntu":true,"OS/2":true,"AIX":true,"QNX":true,"NetBSD":true,"Android":true},"Epiphany":{"Linux":true,"Ubuntu":true,"OpenBSD":true,"FreeBSD":true,"SUSE":true,"Fedora":true,"Debian":true,"Gentoo":true,"Solaris":true},"Camino":{"Mac OS":true},"Chimera":{"Mac OS":true},"Comodo Dragon":{"Windows":true,"Linux":true},"conkeror":{"Debian":true,"Windows":true,"Linux":true},"Conkeror":{"Debian":true},"Links":{"Linux":true,"NetBSD":true,"gentoo":true,"Unix":true,"OpenBSD":true,"FreeBSD":true,"Mac OS":true,"Solaris":true,"Debian":true},"links":{"Linux":true},"Firebird":{"Windows":true,"Mac OS":true,"Solaris":true,"Linux":true},"Swiftfox":{"Linux":true},"Netscape":{"Windows":true,"Mac OS":true,"Linux":true,"Solaris":true,"AIX":true},"Flock":{"Mac OS":true,"Windows":true,"Linux":true},"iCab":{"Mac OS":true,"Windows":true},"Iceape":{"Linux":true},"icecat":{"Linux":true},"IceCat":{"Linux":true},"Iceweasel":{"Linux":true,"Debian":true,"debian":true,"Gentoo":true,"Ubuntu":true},"IceWeasel":{"Ubuntu":true,"Debian":true,"Windows":true},"iceweasel":{"Debian":true},"Iron":{"Windows":true,"Linux":true,"Mac OS":true},"K-Meleon":{"Windows":true,"Linux":true,"FreeBSD":true},"Konqueror":{"Linux":true,"FreeBSD":true,"Fedora":true,"Kubuntu":true,"Slackware":true,"OpenBSD":true,"DragonFly":true,"Windows":true,"Solaris":true,"NetBSD":true,"SUSE":true,"Debian":true},"Lunascape":{"Windows":true},"Lynx":{"GNU":true},"MAXTHON":{"Windows":true},"midori":{"Linux":true},"Midori":{"Linux":true,"FreeBSD":true,"Windows":true},"KHTML":{"Windows":true},"Mosaic":{"Windows":true,"AIX":true,"Solaris":true},"NetSurf":{"RISC OS":true,"Linux":true,"NetBSD":true},"OmniWeb":{"Mac OS":true},"Opera Tablet":{"Windows":true,"Symbian":true},"PaleMoon":{"Windows":true},"Palemoon":{"Windows":true},"Phoenix":{"Linux":true,"Windows":true,"Mac OS":true},"RockMelt":{"Windows":true,"Mac OS":true},"SeaMonkey":{"Windows":true,"Linux":true,"OS/2":true,"Mac OS":true,"FreeBSD":true,"OpenBSD":true,"Fedora":true,"SUSE":true,"Mandriva":true,"Gentoo":true,"BeOS":true,"Haiku":true,"AmigaOS":true,"CentOS":true},"Seamonkey":{"Windows":true,"Linux":true},"Slim":{"Windows":true},"w3m":{"Debian":true},"IceDragon":{"Windows":true},"Waterfox":{"Windows":true,"Linux":true},"GSA":{"iOS":true},"Vivaldi":{"Windows":true,"Linux":true},"Facebook":{"iOS":true,"Android":true},"Chrome WebView":{"Android":true},"QQBrowser":{"Windows":true},"Iridium":{"Windows":true},"Basilisk":{"Windows":true}}