-
Notifications
You must be signed in to change notification settings - Fork 7
/
background.js
29 lines (28 loc) · 940 Bytes
/
background.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
chrome.webRequest.onBeforeSendHeaders.addListener(
function (details) {
details.requestHeaders.forEach(function(requestHeader){
if (requestHeader.name.toLowerCase() === "cookie") {
requestHeader.value = processCookieStr(requestHeader.value);
}
});
return {
requestHeaders: details.requestHeaders
};
}, {
urls: [ "*://*/*" ]
}, ['blocking', 'requestHeaders']
);
chrome.webRequest.onHeadersReceived.addListener(
function (details) {
details.responseHeaders.forEach(function(responseHeader){
if (responseHeader.name.toLowerCase() === "set-cookie") {
responseHeader.value = processSetCookieStr(responseHeader.value);
}
});
return {
responseHeaders: details.responseHeaders
};
}, {
urls: ["*://*/*"]
}, ['blocking','responseHeaders']
);