Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
104 lines
3 KiB
TypeScript
104 lines
3 KiB
TypeScript
// Module ID: 13261
|
|
// Function ID: 13262
|
|
// Name: ProtocolUtils
|
|
// Dependencies: [5110, 2]
|
|
|
|
// Module 13261 (ProtocolUtils)
|
|
import _modDef5110 from "module_5110" /* 5110 */;
|
|
|
|
const os = _modDef5110.os;
|
|
let family;
|
|
if (os != null) {
|
|
family = os.family;
|
|
}
|
|
function launchMobile(href, arg1) {
|
|
closure_0 = arg1;
|
|
location.href = href;
|
|
process.nextTick(() => closure_0(true));
|
|
}
|
|
let tmp3 = launchMobile;
|
|
if ("Android" !== family) {
|
|
const os2 = _modDef5110.os;
|
|
let family1;
|
|
if (os2 != null) {
|
|
family1 = os2.family;
|
|
}
|
|
tmp3 = launchMobile;
|
|
if ("iOS" !== family1) {
|
|
function launchFirefox(href, arg1) {
|
|
closure_0 = arg1;
|
|
if (href.startsWith("discord:")) {
|
|
const _document = document;
|
|
if (null == body) {
|
|
const _process4 = process;
|
|
return process.nextTick(() => closure_0(false));
|
|
} else {
|
|
const _document2 = document;
|
|
const element = <iframe />;
|
|
body.appendChild(element);
|
|
try {
|
|
if (null != element.contentWindow) {
|
|
element.contentWindow.location.href = href;
|
|
}
|
|
const _process2 = process;
|
|
process.nextTick(() => closure_0(true));
|
|
const _window = window;
|
|
const timerId = window.setTimeout(() => {
|
|
let parentElement;
|
|
if (element != null) {
|
|
parentElement = tmp.parentElement;
|
|
}
|
|
if (parentElement == null) {
|
|
parentElement = null;
|
|
}
|
|
if (null !== parentElement) {
|
|
body.removeChild(tmp);
|
|
}
|
|
}, 1000);
|
|
} catch (tmp4) {
|
|
if ("NS_ERROR_UNKNOWN_PROTOCOL" === tmp4.name) {
|
|
const _process3 = tmp.process;
|
|
_process3.nextTick(() => closure_0(false));
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
const _location = location;
|
|
location.href = href;
|
|
const _process = process;
|
|
return process.nextTick(() => closure_0(true));
|
|
}
|
|
}
|
|
if ("Gecko" !== _modDef5110.layout) {
|
|
function launchChrome(href, arg1) {
|
|
closure_0 = arg1;
|
|
function handleBlur() {
|
|
c1 = true;
|
|
}
|
|
c1 = false;
|
|
const listener = window.addEventListener("blur", handleBlur);
|
|
location.href = href;
|
|
const timerId = setTimeout(() => {
|
|
const removed = window.removeEventListener("blur", handleBlur);
|
|
closure_0(c1);
|
|
}, 1000);
|
|
}
|
|
let launchSteam = launchChrome;
|
|
if (null != _modDef5110.ua) {
|
|
const ua = _modDef5110.ua;
|
|
launchSteam = launchChrome;
|
|
if (-1 !== ua.indexOf("Valve Steam GameOverlay")) {
|
|
launchSteam = function launchSteam(arg0, fn) {
|
|
fn(false);
|
|
};
|
|
}
|
|
}
|
|
launchFirefox = launchSteam;
|
|
}
|
|
tmp3 = launchFirefox;
|
|
}
|
|
}
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("utils/web/ProtocolUtils.tsx");
|
|
|
|
export default { launch: tmp3 };
|