fix: Electron HTTP fix + stripped background fix
This commit is contained in:
@@ -64,6 +64,8 @@ function createWindow() {
|
||||
contextIsolation: true,
|
||||
webSecurity: true,
|
||||
preload: path.join(__dirname, "preload.js"),
|
||||
partition: "persist:termix",
|
||||
allowRunningInsecureContent: false,
|
||||
},
|
||||
show: false,
|
||||
});
|
||||
@@ -123,6 +125,20 @@ function createWindow() {
|
||||
delete headers["Content-Security-Policy"];
|
||||
}
|
||||
}
|
||||
|
||||
if (headers["set-cookie"]) {
|
||||
headers["set-cookie"] = headers["set-cookie"].map((cookie) => {
|
||||
let modified = cookie.replace(/;\s*SameSite=Strict/gi, "; SameSite=None");
|
||||
modified = modified.replace(/;\s*SameSite=Lax/gi, "; SameSite=None");
|
||||
if (!modified.includes("SameSite=")) {
|
||||
modified += "; SameSite=None";
|
||||
}
|
||||
if (!modified.includes("Secure") && details.url.startsWith("https")) {
|
||||
modified += "; Secure";
|
||||
}
|
||||
return modified;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
callback({ responseHeaders: headers });
|
||||
|
||||
Reference in New Issue
Block a user