This commit is contained in:
Ray Lothian 2020-12-28 14:17:45 +01:00
parent b9a23d8ce2
commit ae8219dd9e
303 changed files with 321 additions and 24 deletions

View file

@ -1 +0,0 @@
../LICENSE

1
extension/chrome/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../../LICENSE

1
extension/chrome/ReadMe.txt Symbolic link
View file

@ -0,0 +1 @@
../firefox/ReadMe.txt

1
extension/chrome/_locales Symbolic link
View file

@ -0,0 +1 @@
../firefox/_locales

1
extension/chrome/common.js Symbolic link
View file

@ -0,0 +1 @@
../firefox/common.js

1
extension/chrome/data Symbolic link
View file

@ -0,0 +1 @@
../firefox/data

View file

@ -1,12 +1,9 @@
{
"manifest_version": 2,
"name": "__MSG_extensionName__",
"short_name": "useragent-switcher",
"version": "0.4.4",
"default_locale": "en",
"description": "__MSG_extensionDescription__",
"permissions": [
"tabs",
"storage",
@ -16,7 +13,6 @@
"webRequestBlocking",
"contextMenus"
],
"icons": {
"16": "data/icons/active/16.png",
"18": "data/icons/active/18.png",

View file

@ -0,0 +1 @@
../firefox/schema.json

1
extension/chrome/ua-parser.min.js vendored Symbolic link
View file

@ -0,0 +1 @@
../firefox/ua-parser.min.js

View file

@ -1 +0,0 @@
../../../node/browsers/

View file

@ -1 +0,0 @@
../../../node/map.json

View file

@ -1 +0,0 @@
../../../../_/matched/matched.js

View file

@ -1 +0,0 @@
../../../../_/matched/matched.json

1
extension/firefox/LICENSE Symbolic link
View file

@ -0,0 +1 @@
../../LICENSE

View file

@ -495,6 +495,7 @@ const onBeforeSendHeaders = d => {
return {};
}
const o = (cache[tabId] || ua.object(tabId, undefined, cookieStoreId));
const str = o ? o.userAgent : '';
if (str && requestHeaders.length) {
for (let i = 0, name = requestHeaders[0].name; i < requestHeaders.length; i += 1, name = (requestHeaders[i] || {}).name) {
@ -577,6 +578,22 @@ chrome.storage.local.get({
}
});
/* message passing */
chrome.runtime.onMessage.addListener((request, sender, response) => {
if (request.method === 'parse-ua') {
response(ua.parse(request.value));
}
else if (request.method === 'get-ua') {
response(prefs.ua || '' || navigator.userAgent);
}
else if (request.method === 'request-update') {
if (request.delete) {
delete ua._obj[request.cookieStoreId];
}
ua.update(request.value, undefined, request.cookieStoreId);
}
});
/* FAQs & Feedback */
{
const {management, runtime: {onInstalled, setUninstallURL, getManifest}, storage, tabs} = chrome;

View file

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View file

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View file

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 5 KiB

Some files were not shown because too many files have changed in this diff Show more