updating list; fixes #71
This commit is contained in:
parent
d7c7aa930c
commit
61a13d5962
90 changed files with 123 additions and 93 deletions
|
@ -385,16 +385,14 @@ const onCommitted = ({frameId, url, tabId}) => {
|
|||
}\`;
|
||||
document.documentElement.appendChild(script);
|
||||
script.remove();
|
||||
navigator.userAgent
|
||||
}`
|
||||
}, r => {
|
||||
}, () => {
|
||||
const lastError = chrome.runtime.lastError;
|
||||
if (lastError &&
|
||||
lastError.message !== 'No matching message handler' && // Firefox on Windows
|
||||
lastError.message !== 'document.documentElement is null' // Firefox on Windows
|
||||
) {
|
||||
if (frameId === 0) {
|
||||
console.log(lastError);
|
||||
ua.tooltip('[Default] ' + navigator.userAgent, tabId);
|
||||
ua.icon('ignored', tabId);
|
||||
}
|
||||
|
@ -416,29 +414,31 @@ chrome.contextMenus.onClicked.addListener(info => chrome.storage.local.set({
|
|||
mode: info.menuItemId
|
||||
}));
|
||||
|
||||
// FAQs & Feedback
|
||||
/* FAQs & Feedback */
|
||||
{
|
||||
const {onInstalled, setUninstallURL, getManifest} = chrome.runtime;
|
||||
const {name, version} = getManifest();
|
||||
const page = getManifest().homepage_url;
|
||||
onInstalled.addListener(({reason, previousVersion}) => {
|
||||
chrome.storage.local.get({
|
||||
'faqs': true,
|
||||
'last-update': 0
|
||||
}, prefs => {
|
||||
if (reason === 'install' || (prefs.faqs && reason === 'update')) {
|
||||
const doUpdate = (Date.now() - prefs['last-update']) / 1000 / 60 / 60 / 24 > 45;
|
||||
if (doUpdate && previousVersion !== version) {
|
||||
chrome.tabs.create({
|
||||
url: page + '?version=' + version +
|
||||
(previousVersion ? '&p=' + previousVersion : '') +
|
||||
'&type=' + reason,
|
||||
active: reason === 'install'
|
||||
});
|
||||
chrome.storage.local.set({'last-update': Date.now()});
|
||||
if (navigator.webdriver !== true) {
|
||||
onInstalled.addListener(({reason, previousVersion}) => {
|
||||
chrome.storage.local.get({
|
||||
'faqs': true,
|
||||
'last-update': 0
|
||||
}, prefs => {
|
||||
if (reason === 'install' || (prefs.faqs && reason === 'update')) {
|
||||
const doUpdate = (Date.now() - prefs['last-update']) / 1000 / 60 / 60 / 24 > 45;
|
||||
if (doUpdate && previousVersion !== version) {
|
||||
chrome.tabs.create({
|
||||
url: page + '?version=' + version +
|
||||
(previousVersion ? '&p=' + previousVersion : '') +
|
||||
'&type=' + reason,
|
||||
active: reason === 'install'
|
||||
});
|
||||
chrome.storage.local.set({'last-update': Date.now()});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
setUninstallURL(page + '?rd=feedback&name=' + encodeURIComponent(name) + '&version=' + version);
|
||||
setUninstallURL(page + '?rd=feedback&name=' + encodeURIComponent(name) + '&version=' + version);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
../../../../shared/matched/matched.js
|
||||
../../../../_/matched/matched.js
|
|
@ -1 +1 @@
|
|||
../../../../shared/matched/matched.json
|
||||
../../../../_/matched/matched.json
|
|
@ -4,7 +4,7 @@
|
|||
"short_name": "useragent-switcher",
|
||||
"version": "0.3.4",
|
||||
|
||||
"description": "A highly customizable extension to spoof the User-Agent string of your browser with a new one globally, randomly or per hostname",
|
||||
"description": "Spoof websites trying to gather information about your web navigation to deliver distinct content you may not want",
|
||||
|
||||
"permissions": [
|
||||
"tabs",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue