-1
我從browser.storage中抓取了一些URL,並試圖將它們結合起來。這可能嗎?以編程方式組合browser.webRequest.onHeaders接收的URL
實施例:
var testurls = "'*://site1.com/*'," + "'*://site2.com/*'";
browser.webRequest.onHeadersReceived.addListener(setHeader,
{urls: [testurls]},
['blocking', 'responseHeaders']
);
['urls'](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webRequest/RequestFilter#Type)是[陣列(https://開頭developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)[匹配模式](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/ WebExtensions/Match_patterns),而不是包含在單個字符串中的逗號分隔列表。 – Makyen