aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorAlessio Vanni <vannilla@firemail.cc>2019-02-19 23:01:47 +0100
committerAlessio Vanni <vannilla@firemail.cc>2019-02-19 23:01:47 +0100
commit768c3853f3743cfcf4d58c97a4ce061df9ebaafe (patch)
tree18f7aae16a0b034f4510167c9bcb3a35bed5930a /js
parent267b9e0f19080a9131bd84df1c519474d4f0602e (diff)
downloadematrix-768c3853f3743cfcf4d58c97a4ce061df9ebaafe.tar.lz
ematrix-768c3853f3743cfcf4d58c97a4ce061df9ebaafe.tar.xz
ematrix-768c3853f3743cfcf4d58c97a4ce061df9ebaafe.zip
Fix some issue from applying the patch
Not sure what happened to be honest.
Diffstat (limited to 'js')
-rw-r--r--js/vapi-background.js51
1 files changed, 25 insertions, 26 deletions
diff --git a/js/vapi-background.js b/js/vapi-background.js
index 7dfe924..eb401bc 100644
--- a/js/vapi-background.js
+++ b/js/vapi-background.js
@@ -1667,8 +1667,8 @@ HTTPRequestHeaders.prototype.init = function(channel) {
this.headers = new Array();
this.originalHeaderNames = new Array();
channel.visitRequestHeaders({visitHeader: function(name, value) {
- this.headers.push({name: name, value: value});
- this.originalHeaderNames.push(name);
+ this.headers.push({name: name, value: value});
+ this.originalHeaderNames.push(name);
}.bind(this)});
return this;
};
@@ -1683,14 +1683,14 @@ HTTPRequestHeaders.prototype.dispose = function() {
HTTPRequestHeaders.prototype.update = function() {
var newHeaderNames = new Set();
for ( var header of this.headers ) {
- this.setHeader(header.name, header.value, true);
- newHeaderNames.add(header.name);
+ this.setHeader(header.name, header.value, true);
+ newHeaderNames.add(header.name);
}
//Clear any headers that were removed
for ( var name of this.originalHeaderNames ) {
- if ( !newHeaderNames.has(name) ) {
- this.channel.setRequestHeader(name, '', false);
- }
+ if ( !newHeaderNames.has(name) ) {
+ this.channel.setRequestHeader(name, '', false);
+ }
}
}
@@ -1929,11 +1929,11 @@ var httpObserver = {
tabId: tabId,
type: type,
url: URI.asciiSpec,
- method:channel.requestMethod
+ method: channel.requestMethod
});
- if ( newHeaders ) {
- requestHeaders.update();
- }
+ if ( newHeaders ) {
+ requestHeaders.update();
+ }
requestHeaders.dispose();
}
@@ -2036,15 +2036,14 @@ var httpObserver = {
}
//topic = ['Content-Security-Policy', 'Content-Security-Policy-Report-Only'];
- // Can send empty responseHeaders as these headers are only added and then merged
-
+ // Can send empty responseHeaders as these headers are only added to and then merged.
- // TODO: Find better place for this, needs to be set before onHeadersReceived.callback
- // Web workers not blocked in Pale Moon as child-src currently unavailable, see:
- // https://github.com/MoonchildProductions/Pale-Moon/issues/949
- if (μMatrix.cspNoWorker === undefined) {
- μMatrix.cspNoWorker = "child-src 'none'; frame-src data: blob: *; report-uri about:blank";
- }
+ // TODO: Find better place for this, needs to be set before onHeadersReceived.callback.
+ // Web workers not blocked in Pale Moon as child-src currently unavailable, see:
+ // https://github.com/MoonchildProductions/Pale-Moon/issues/949
+ if ( µMatrix.cspNoWorker === undefined ) {
+ µMatrix.cspNoWorker = "child-src 'none'; frame-src data: blob: *; report-uri about:blank";
+ }
var result = vAPI.net.onHeadersReceived.callback({
parentFrameId: type === 'main_frame' ? -1 : 0,
@@ -2055,14 +2054,14 @@ var httpObserver = {
});
if ( result ) {
- for (let header of result.reponseHeaders ) {
- channel.setResponseHeader(
- header.name,
- header.value,
- true
+ for ( let header of result.responseHeaders ) {
+ channel.setResponseHeader(
+ header.name,
+ header.value,
+ true
);
- }
- }
+ }
+ }
return;
}