mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
golf useragent to ua
This commit is contained in:
parent
c03af9cfcc
commit
40a1c7116e
|
@ -23,8 +23,7 @@ var dbg = function () { };
|
||||||
|
|
||||||
// dodge browser issues
|
// dodge browser issues
|
||||||
(function () {
|
(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
|
// necessary on ff-68.7 at least
|
||||||
var s = mknod('style');
|
var s = mknod('style');
|
||||||
s.innerHTML = '@page { margin: .5in .6in .8in .6in; }';
|
s.innerHTML = '@page { margin: .5in .6in .8in .6in; }';
|
||||||
|
|
|
@ -450,7 +450,7 @@ function savechk_cb() {
|
||||||
|
|
||||||
// firefox bug: initial selection offset isn't cleared properly through js
|
// firefox bug: initial selection offset isn't cleared properly through js
|
||||||
var ff_clearsel = (function () {
|
var ff_clearsel = (function () {
|
||||||
if (navigator.userAgent.indexOf(') Gecko/') === -1)
|
if (UA.indexOf(') Gecko/') === -1)
|
||||||
return function () { }
|
return function () { }
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
function QSA(x) {
|
function QSA(x) {
|
||||||
return document.querySelectorAll(x);
|
return document.querySelectorAll(x);
|
||||||
}
|
}
|
||||||
var LINUX = /Linux/.test(navigator.userAgent),
|
var LINUX = /Linux/.test(UA),
|
||||||
MACOS = /[^a-z]mac ?os/i.test(navigator.userAgent),
|
MACOS = /[^a-z]mac ?os/i.test(UA),
|
||||||
WINDOWS = /Windows/.test(navigator.userAgent);
|
WINDOWS = /Windows/.test(UA);
|
||||||
|
|
||||||
|
|
||||||
var oa = QSA('pre');
|
var oa = QSA('pre');
|
||||||
|
|
|
@ -969,7 +969,7 @@ function up2k_init(subtle) {
|
||||||
ud = function () { ebi('dir' + fdom_ctr).click(); };
|
ud = function () { ebi('dir' + fdom_ctr).click(); };
|
||||||
|
|
||||||
// too buggy on chrome <= 72
|
// 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)
|
if (m && parseInt(m[1]) < 73)
|
||||||
return uf();
|
return uf();
|
||||||
|
|
||||||
|
|
|
@ -31,12 +31,13 @@ var wah = '',
|
||||||
MOBILE = TOUCH,
|
MOBILE = TOUCH,
|
||||||
CHROME = !!window.chrome, // safari=false
|
CHROME = !!window.chrome, // safari=false
|
||||||
VCHROME = CHROME ? 1 : 0,
|
VCHROME = CHROME ? 1 : 0,
|
||||||
IE = /Trident\//.test(navigator.userAgent),
|
UA = '' + navigator.userAgent,
|
||||||
FIREFOX = ('netscape' in window) && / rv:/.test(navigator.userAgent),
|
IE = /Trident\//.test(UA),
|
||||||
IPHONE = TOUCH && /iPhone|iPad|iPod/i.test(navigator.userAgent),
|
FIREFOX = ('netscape' in window) && / rv:/.test(UA),
|
||||||
LINUX = /Linux/.test(navigator.userAgent),
|
IPHONE = TOUCH && /iPhone|iPad|iPod/i.test(UA),
|
||||||
MACOS = /[^a-z]mac ?os/i.test(navigator.userAgent),
|
LINUX = /Linux/.test(UA),
|
||||||
WINDOWS = /Windows/.test(navigator.userAgent);
|
MACOS = /[^a-z]mac ?os/i.test(UA),
|
||||||
|
WINDOWS = /Windows/.test(UA);
|
||||||
|
|
||||||
if (!window.WebAssembly || !WebAssembly.Memory)
|
if (!window.WebAssembly || !WebAssembly.Memory)
|
||||||
window.WebAssembly = false;
|
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="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 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 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 {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue