google-chrome-extension

chrome webrequest api array of urls?

懵懂的女人 提交于 2020-08-26 08:54:38
问题 Here is the code for a very simple chrome extension that blocks manually specified websites. chrome.webRequest.onBeforeRequest.addListener(function(details) { return {cancel: true}; }, {urls: ["*://*.google.com/*", "*://*.facebook.com/*"]}, ["blocking"]); I'm wondering if it's possible to make this url list equal to an array of websites, and if so what the syntax is. My goal is to retrieve a list of websites from a websocket server, then have my chrome extension block them. Here is my code.

chrome webrequest api array of urls?

北城余情 提交于 2020-08-26 08:54:27
问题 Here is the code for a very simple chrome extension that blocks manually specified websites. chrome.webRequest.onBeforeRequest.addListener(function(details) { return {cancel: true}; }, {urls: ["*://*.google.com/*", "*://*.facebook.com/*"]}, ["blocking"]); I'm wondering if it's possible to make this url list equal to an array of websites, and if so what the syntax is. My goal is to retrieve a list of websites from a websocket server, then have my chrome extension block them. Here is my code.