From 6c34ee014aecb9248d519bae0ab64aebab5b3e31 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sun, 15 Jan 2023 22:16:33 +0100 Subject: use custom user-agent for masterserver requests --- src/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 16eebfe..638bebb 100644 --- a/src/index.js +++ b/src/index.js @@ -8,6 +8,7 @@ process.chdir(app.getPath("appData")); const utils = require("./utils"); const cli = require("./cli"); +const json = require("./modules/json"); const mods = require("./modules/mods"); const settings = require("./modules/settings"); const requests = require("./modules/requests"); @@ -30,6 +31,8 @@ function start() { // as it's fairly responsive, but for now we won't allow that. resizable: false, + userAgent: "test", + frame: false, titleBarStyle: "hidden", icon: path.join(__dirname, "assets/icons/512x512.png"), @@ -45,7 +48,9 @@ function start() { // general setup win.removeMenu(); - win.loadFile(__dirname + "/app/index.html"); + win.loadURL("file://" + __dirname + "/app/index.html", { + userAgent: "viper/" + json(path.join(__dirname, "../package.json")).version, + }); win.send = (channel, data) => { win.webContents.send(channel, data); -- cgit v1.2.3