fixes #114
|
@ -1 +0,0 @@
|
|||
../LICENSE
|
1
extension/chrome/LICENSE
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../LICENSE
|
1
extension/chrome/ReadMe.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
../firefox/ReadMe.txt
|
1
extension/chrome/_locales
Symbolic link
|
@ -0,0 +1 @@
|
|||
../firefox/_locales
|
1
extension/chrome/common.js
Symbolic link
|
@ -0,0 +1 @@
|
|||
../firefox/common.js
|
1
extension/chrome/data
Symbolic link
|
@ -0,0 +1 @@
|
|||
../firefox/data
|
|
@ -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",
|
1
extension/chrome/schema.json
Symbolic link
|
@ -0,0 +1 @@
|
|||
../firefox/schema.json
|
1
extension/chrome/ua-parser.min.js
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../firefox/ua-parser.min.js
|
|
@ -1 +0,0 @@
|
|||
../../../node/browsers/
|
|
@ -1 +0,0 @@
|
|||
../../../node/map.json
|
|
@ -1 +0,0 @@
|
|||
../../../../_/matched/matched.js
|
|
@ -1 +0,0 @@
|
|||
../../../../_/matched/matched.json
|
1
extension/firefox/LICENSE
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../LICENSE
|
|
@ -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;
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |