Which ResourceType do I have to use for the RequestFilter so that my chrome.webRequest.onHeadersReceived
listener takes up the least amout of resources?
I think it's either "object"
or "other"
but I didn't find any information about this.
Because at the moment I use {urls: ["<all_urls>"]}
to catch all requests and then the code below to check for video requests:
chrome.webRequest.onHeadersReceived.addListener(function (details) {
details.responseHeaders.forEach(function (header) {
if (header.name.toLowerCase() === "content-type") {
var type = header.value.toLowerCase().split('/');
if (type[0] === "video") {
type = type[1].split(';')[0];
alert("Request for " + type + " video registered.");
}
}
});
}, {urls: ["<all_urls>"]}, ["responseHeaders"]);