golf useragent to ua

This commit is contained in:
ed 2025-01-24 19:56:56 +00:00
parent c03af9cfcc
commit 40a1c7116e
5 changed files with 14 additions and 14 deletions

View file

@ -23,8 +23,7 @@ var dbg = function () { };
// dodge browser issues
(function () {
var ua = navigator.userAgent;
if (ua.indexOf(') Gecko/') !== -1 && /Linux| Mac /.exec(ua)) {
if (UA.indexOf(') Gecko/') !== -1 && /Linux| Mac /.exec(UA)) {
// necessary on ff-68.7 at least
var s = mknod('style');
s.innerHTML = '@page { margin: .5in .6in .8in .6in; }';

View file

@ -450,7 +450,7 @@ function savechk_cb() {
// firefox bug: initial selection offset isn't cleared properly through js
var ff_clearsel = (function () {
if (navigator.userAgent.indexOf(') Gecko/') === -1)
if (UA.indexOf(') Gecko/') === -1)
return function () { }
return function () {

View file

@ -1,9 +1,9 @@
function QSA(x) {
return document.querySelectorAll(x);
}
var LINUX = /Linux/.test(navigator.userAgent),
MACOS = /[^a-z]mac ?os/i.test(navigator.userAgent),
WINDOWS = /Windows/.test(navigator.userAgent);
var LINUX = /Linux/.test(UA),
MACOS = /[^a-z]mac ?os/i.test(UA),
WINDOWS = /Windows/.test(UA);
var oa = QSA('pre');

View file

@ -969,7 +969,7 @@ function up2k_init(subtle) {
ud = function () { ebi('dir' + fdom_ctr).click(); };
// too buggy on chrome <= 72
var m = / Chrome\/([0-9]+)\./.exec(navigator.userAgent);
var m = / Chrome\/([0-9]+)\./.exec(UA);
if (m && parseInt(m[1]) < 73)
return uf();

View file

@ -31,12 +31,13 @@ var wah = '',
MOBILE = TOUCH,
CHROME = !!window.chrome, // safari=false
VCHROME = CHROME ? 1 : 0,
IE = /Trident\//.test(navigator.userAgent),
FIREFOX = ('netscape' in window) && / rv:/.test(navigator.userAgent),
IPHONE = TOUCH && /iPhone|iPad|iPod/i.test(navigator.userAgent),
LINUX = /Linux/.test(navigator.userAgent),
MACOS = /[^a-z]mac ?os/i.test(navigator.userAgent),
WINDOWS = /Windows/.test(navigator.userAgent);
UA = '' + navigator.userAgent,
IE = /Trident\//.test(UA),
FIREFOX = ('netscape' in window) && / rv:/.test(UA),
IPHONE = TOUCH && /iPhone|iPad|iPod/i.test(UA),
LINUX = /Linux/.test(UA),
MACOS = /[^a-z]mac ?os/i.test(UA),
WINDOWS = /Windows/.test(UA);
if (!window.WebAssembly || !WebAssembly.Memory)
window.WebAssembly = false;
@ -196,7 +197,7 @@ function vis_exh(msg, url, lineNo, columnNo, error) {
'<p style="font-size:1.3em;margin:0;line-height:2em">try to <a href="#" onclick="localStorage.clear();location.reload();">reset copyparty settings</a> if you are stuck here, or <a href="#" onclick="ignex();">ignore this</a> / <a href="#" onclick="ignex(true);">ignore all</a> / <a href="?b=u">basic</a></p>',
'<p style="color:#fff">please send me a screenshot arigathanks gozaimuch: <a href="<ghi>" target="_blank">new github issue</a></p>',
'<p class="b">' + esc(url + ' @' + lineNo + ':' + columnNo), '<br />' + esc(msg).replace(/\n/g, '<br />') + '</p>',
'<p><b>UA:</b> ' + esc(navigator.userAgent + '')
'<p><b>UA:</b> ' + esc(UA)
];
try {