aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2023-01-15 22:16:33 +0100
committer0neGal <mail@0negal.com>2023-01-15 22:20:40 +0100
commit6c34ee014aecb9248d519bae0ab64aebab5b3e31 (patch)
tree0ba5c59bc137e62c4c70c8eea2b020008f22fa5b
parent290b2c06f7f13d185669cd8b1910e294a134b5be (diff)
downloadViper-6c34ee014aecb9248d519bae0ab64aebab5b3e31.tar.gz
Viper-6c34ee014aecb9248d519bae0ab64aebab5b3e31.zip
use custom user-agent for masterserver requests
-rw-r--r--src/index.js7
1 files changed, 6 insertions, 1 deletions
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);