From 21da9a9729c4cf25ddcfbdad27bf57431bc3fff4 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Wed, 8 Jan 2025 23:24:11 -0700 Subject: [PATCH] misc.firefox: --windows --- src/modules/misc/firefox.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/misc/firefox.js b/src/modules/misc/firefox.js index 519bf78..3200d6c 100644 --- a/src/modules/misc/firefox.js +++ b/src/modules/misc/firefox.js @@ -3,10 +3,12 @@ const Command = require("#lib/command.js"); const firefox = new Command("firefox"); firefox.category = "misc"; firefox.helpText = "Get the approximate latest Firefox user-agent"; -firefox.callback = function (msg, line) { +firefox.callback = function (msg, line, args, {windows}) { const now = Math.floor(Date.now() / 1000); const version = Math.floor(124 + (now - 1710892800) / 2419200); + let os = "X11; Linux x86_64"; + if (windows) os = "Windows NT 10.0; Win64; x64;"; - return `\`Mozilla/5.0 (X11; Linux x86_64; rv:${version}.0) Gecko/20100101 Firefox/${version}.0\``; + return `\`Mozilla/5.0 (${os} rv:${version}.0) Gecko/20100101 Firefox/${version}.0\``; }; hf.registerCommand(firefox);