[util] adjust Firefox/Chrome UA versions

modify 'ordinal' offsets to get the correct version numbers
This commit is contained in:
Mike Fährmann
2026-01-03 09:34:33 +01:00
parent 02aab26a17
commit e33a63231f
2 changed files with 6 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2025 Mike Fährmann
# Copyright 2017-2026 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -697,8 +697,9 @@ class Flags():
# _ff_ver = (_ord_today - 735506) // 28
# _ch_ver = (_ord_today - 735562) // 28
_ff_ver = (dt.date.today().toordinal() - 735506) // 28
# _ch_ver = _ff_ver - 2
_ord_today = dt.date.today().toordinal()
_ff_ver = (_ord_today - 735_513) // 28 # 147 on 2026-01-13
_ch_ver = (_ord_today - 735_599) // 28 # 143 on 2025-12-18
re = text.re
re_compile = text.re_compile
@@ -720,7 +721,7 @@ USERAGENT_FIREFOX = (f"Mozilla/5.0 (Windows NT 10.0; Win64; x64; "
f"rv:{_ff_ver}.0) Gecko/20100101 Firefox/{_ff_ver}.0")
USERAGENT_CHROME = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
f"Chrome/{_ff_ver - 2}.0.0.0 Safari/537.36")
f"Chrome/{_ch_ver}.0.0.0 Safari/537.36")
GLOBALS = {
"contains" : contains,

View File

@@ -6,5 +6,5 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
__version__ = "1.31.2"
__version__ = "1.31.3-dev"
__variant__ = None