Created
October 22, 2021 09:00
-
-
Save t57ser/a34dfe9579b856e6e765b59fb8d215cb to your computer and use it in GitHub Desktop.
[Bug]: No longer possible to set insecure cookies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const electron = require("electron"); | |
const { app, BrowserWindow } = require("electron"); | |
const path = require("path"); | |
function init() { | |
let browserWindow = new BrowserWindow({ | |
show: true, | |
webPreferences: { | |
partition: "persist:test-2", | |
} | |
}); | |
const session = electron.session.fromPartition("persist:test-2"); | |
session.cookies.set({ | |
name: "testcookie", | |
value: "testvalue", | |
domain: ".testdomain.com", | |
path: "/", | |
url: "http://testdomain.com", | |
}).then(() => { | |
console.log("setting cookie success"); | |
}).catch((e) => { | |
console.error(e); | |
}); | |
} | |
app.on("ready", () => { | |
init(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"main": "main.js", | |
"scripts": { | |
"start": "electron ." | |
}, | |
"devDependencies": { | |
"electron": "15.3.0" | |
}, | |
"dependencies": { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment