hi, i have a huge problem with my add-on i use:
‘use strict’;
let db = []; // session Global
// ----- parse & cache the database data
fetch(‘https://www.stop-it.be/upload/myfile.dat’)
.then(response => response.text())
.then(text => { db = text.trim().split(/[\r\n]+/); })
.catch(error => console.log(error));
chrome.webRequest.onBeforeRequest.addListener( details => {
let url = new URL(details.url);
return { cancel: url && url.hostname && db.includes(url.hostname) };
},
{urls: [“http:///”, “https:///”]},
[“blocking”]
);
BUT urls just ‘xxx.com’ url’s, inside the “myfile.dat” are no more blocked by my add-on do someone know why something is wrong??
myfile.dat is not the real name of my file, it’s just for explaining the error i have.
it’s URGENT !!!
Thanks