decord/alpha/source/utils/web/ProtocolUtils.tsx

106 lines
3 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 13521
// Function ID: 13522
// Name: ProtocolUtils
2026-10-10 08:08:14 +00:00
// Dependencies: [5219, 2]
2026-07-20 16:05:17 +00:00
2026-10-13 12:43:34 +00:00
// Module 13521 (ProtocolUtils)
2026-10-10 08:08:14 +00:00
import _modDef5219 from "module_5219" /* 5219 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
2026-10-10 08:08:14 +00:00
const os = _modDef5219.os;
2026-07-29 08:29:29 +00:00
let family;
if (os != null) {
family = os.family;
2026-07-20 16:05:17 +00:00
}
function launchMobile(href, arg1) {
2026-10-03 08:58:59 +00:00
let closure_0 = arg1;
2026-07-20 16:05:17 +00:00
location.href = href;
process.nextTick(() => closure_0(true));
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp3 = launchMobile;
2026-07-20 16:05:17 +00:00
if ("Android" !== family) {
2026-10-10 08:08:14 +00:00
const os2 = _modDef5219.os;
2026-07-20 16:05:17 +00:00
let family1;
2026-07-29 08:29:29 +00:00
if (os2 != null) {
2026-07-20 16:05:17 +00:00
family1 = os2.family;
}
2026-07-29 08:29:29 +00:00
tmp3 = launchMobile;
2026-07-20 16:05:17 +00:00
if ("iOS" !== family1) {
function launchFirefox(href, arg1) {
2026-10-03 08:58:59 +00:00
let closure_0 = arg1;
if (href.startsWith("discord:")) {
2026-07-29 08:29:29 +00:00
const _document = document;
2026-10-03 08:58:59 +00:00
const tmp = null;
2026-07-29 08:29:29 +00:00
if (null == body) {
const _process4 = process;
return process.nextTick(() => closure_0(false));
2026-07-29 08:29:29 +00:00
} else {
const _document2 = document;
const element = <iframe />;
body.appendChild(element);
try {
if (null != element.contentWindow) {
element.contentWindow.location.href = href;
2026-07-29 08:29:29 +00:00
}
const _process2 = process;
process.nextTick(() => closure_0(true));
2026-10-03 08:58:59 +00:00
} catch (tmp3) {
if ("NS_ERROR_UNKNOWN_PROTOCOL" === tmp3.name) {
const _process3 = process;
process.nextTick(() => closure_0(false));
2026-07-29 08:29:29 +00:00
}
}
2026-10-03 08:58:59 +00:00
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(element);
}
}, 1000);
2026-07-29 08:29:29 +00:00
}
} else {
const _location = location;
location.href = href;
2026-07-29 08:29:29 +00:00
const _process = process;
return process.nextTick(() => closure_0(true));
2026-07-20 16:05:17 +00:00
}
}
2026-10-10 08:08:14 +00:00
if ("Gecko" !== _modDef5219.layout) {
function launchChrome(href, arg1) {
2026-10-03 08:58:59 +00:00
let closure_0 = arg1;
2026-07-29 08:29:29 +00:00
function handleBlur() {
2026-08-24 06:08:38 +00:00
c1 = true;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
let c1 = false;
2026-07-29 08:29:29 +00:00
const listener = window.addEventListener("blur", handleBlur);
location.href = href;
const timerId = setTimeout(() => {
const removed = window.removeEventListener("blur", handleBlur);
closure_0(c1);
2026-07-29 08:29:29 +00:00
}, 1000);
}
let launchSteam = launchChrome;
2026-10-10 08:08:14 +00:00
if (null != _modDef5219.ua) {
const ua = _modDef5219.ua;
2026-07-29 08:29:29 +00:00
launchSteam = launchChrome;
if (-1 !== ua.indexOf("Valve Steam GameOverlay")) {
launchSteam = function launchSteam(arg0, fn) {
fn(false);
2026-07-29 08:29:29 +00:00
};
}
}
launchFirefox = launchSteam;
}
tmp3 = launchFirefox;
2026-07-20 16:05:17 +00:00
}
}
const result = size.fileFinishedImporting("utils/web/ProtocolUtils.tsx");
2026-07-29 08:29:29 +00:00
export default { launch: tmp3 };