This commit is contained in:
Ray Lothian 2019-03-13 10:24:03 +01:00
parent 8b93a731b0
commit 1872fbcb3c

View file

@ -183,7 +183,7 @@ function match({url, tabId}) {
if (prefs.mode === 'blacklist') { if (prefs.mode === 'blacklist') {
if (prefs.blacklist.length) { if (prefs.blacklist.length) {
const h = hostname(url); const h = hostname(url);
return prefs.blacklist.some(s => () => { return prefs.blacklist.some(s => {
if (s === h) { if (s === h) {
return true; return true;
} }
@ -254,11 +254,13 @@ var onBeforeSendHeaders = ({tabId, url, requestHeaders, type}) => {
}; };
var onCommitted = ({frameId, url, tabId}) => { var onCommitted = ({frameId, url, tabId}) => {
console.log(url, cache[tabId] === true);
if (url && (url.startsWith('http') || url.startsWith('ftp')) || url === 'about:blank') { if (url && (url.startsWith('http') || url.startsWith('ftp')) || url === 'about:blank') {
if (cache[tabId] === true) { if (cache[tabId] === true) {
return; return;
} }
const o = cache[tabId] || ua.object(tabId); const o = cache[tabId] || ua.object(tabId);
console.log(o, url);
if (o.userAgent) { if (o.userAgent) {
let {userAgent, appVersion, platform, vendor} = o; let {userAgent, appVersion, platform, vendor} = o;
if (o.userAgent === 'empty') { if (o.userAgent === 'empty') {