feat: ds
This commit is contained in:
@@ -27,23 +27,10 @@ function labAssetBase() {
|
||||
return '';
|
||||
}
|
||||
function labApiBase() {
|
||||
try {
|
||||
var ex = (typeof window !== 'undefined' && window.__LAB_EXFIL__ && window.__LAB_EXFIL__.host)
|
||||
? window.__LAB_EXFIL__
|
||||
: (typeof window !== 'undefined' && window.NEWS2_CONFIG && window.NEWS2_CONFIG.exfil);
|
||||
if (ex && ex.host) {
|
||||
var tls = !!(ex.tls || ex.prefer_https);
|
||||
var port = Number(tls ? (ex.https_port || 443) : (ex.http_port || 80)) || (tls ? 443 : 80);
|
||||
if (!tls && port === 443) { tls = true; }
|
||||
var origin = (tls ? 'https://' : 'http://') + String(ex.host).replace(/^https?:\/\//, '').split('/')[0].split(':')[0];
|
||||
if (!((tls && port === 443) || (!tls && port === 80))) origin += ':' + port;
|
||||
return origin;
|
||||
}
|
||||
} catch (e0) {}
|
||||
try {
|
||||
if (typeof location !== 'undefined' && location.origin && location.origin !== 'null')
|
||||
return String(location.origin).replace(/\/$/, '');
|
||||
} catch (e1) {}
|
||||
} catch (e0) {}
|
||||
return '';
|
||||
}
|
||||
var localHost = labAssetBase();
|
||||
|
||||
Reference in New Issue
Block a user