Fixed: [Chromium] extraHeaders permission for sanitization (#442)
This commit is contained in:
parent
139b933e4a
commit
e0a36874fc
|
@ -26,6 +26,7 @@
|
|||
"CDNs": true,
|
||||
"IgnoredHost": true,
|
||||
"EncodingTypes": true,
|
||||
"ExtraInfoSpec": true,
|
||||
|
||||
"fileGuard": true,
|
||||
"files": true,
|
||||
|
|
|
@ -117,7 +117,8 @@ const WebRequest = {
|
|||
'GET': 'GET',
|
||||
'BLOCKING': 'blocking',
|
||||
'HEADERS': 'requestHeaders',
|
||||
'RESPONSE_HEADERS': 'responseHeaders'
|
||||
'RESPONSE_HEADERS': 'responseHeaders',
|
||||
'EXTRA_HEADERS': 'extraHeaders'
|
||||
};
|
||||
|
||||
const WebRequestType = {
|
||||
|
|
|
@ -21,26 +21,36 @@
|
|||
var requestSanitizer = {};
|
||||
|
||||
|
||||
/**
|
||||
* Preparation
|
||||
* https://codeberg.org/nobody/LocalCDN/issues/442
|
||||
*/
|
||||
|
||||
/* eslint-disable indent */
|
||||
const ExtraInfoSpec = BrowserType.FIREFOX
|
||||
? [WebRequest.BLOCKING, WebRequest.HEADERS]
|
||||
: [WebRequest.BLOCKING, WebRequest.HEADERS, WebRequest.EXTRA_HEADERS];
|
||||
/* eslint-enable indent */
|
||||
|
||||
|
||||
/**
|
||||
* Public Methods
|
||||
*/
|
||||
|
||||
requestSanitizer.enable = function () {
|
||||
|
||||
let onBeforeSendHeaders = chrome.webRequest.onBeforeSendHeaders;
|
||||
|
||||
onBeforeSendHeaders.addListener(requestSanitizer._stripMetadata, {
|
||||
'urls': stateManager.validHosts
|
||||
}, [WebRequest.BLOCKING, WebRequest.HEADERS]);
|
||||
}, ExtraInfoSpec);
|
||||
};
|
||||
|
||||
requestSanitizer.disable = function () {
|
||||
|
||||
let onBeforeSendHeaders = chrome.webRequest.onBeforeSendHeaders;
|
||||
|
||||
onBeforeSendHeaders.removeListener(requestSanitizer._stripMetadata, {
|
||||
'urls': stateManager.validHosts
|
||||
}, [WebRequest.BLOCKING, WebRequest.HEADERS]);
|
||||
}, ExtraInfoSpec);
|
||||
};
|
||||
|
||||
|
||||
|
@ -78,7 +88,6 @@ requestSanitizer._stripMetadata = function (requestDetails) {
|
|||
*/
|
||||
|
||||
storageManager.type.get({[Setting.STRIP_METADATA]: true}, function (items) {
|
||||
|
||||
if (items === null || items.stripMetadata !== false) {
|
||||
requestSanitizer.enable();
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
<li>Improved: HTML filter inside frames (<a href="https://codeberg.org/nobody/LocalCDN/issues/439">#439</a>)</li>
|
||||
<li>Added: leaflet.featuregroup.subgroup v1.0.2 (<a href="https://codeberg.org/nobody/LocalCDN/issues/440">#440</a>)</li>
|
||||
<li>Added: Leaflet.EasyButton v2.4.0 (<a href="https://codeberg.org/nobody/LocalCDN/issues/441">#441</a>)</li>
|
||||
<li>Fixed: [Chromium] extraHeaders permission for sanitization (<a href="https://codeberg.org/nobody/LocalCDN/issues/442">#442</a>)</li>
|
||||
</ul>
|
||||
<div id="generator-section">
|
||||
<div class="topic-label">
|
||||
|
|
Loading…
Reference in New Issue