decord/stable/source/utils/web/ProtocolUtils.tsx
github-actions e2bc0408ee chore: update source for stable 346.13
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-22 22:11:40 +00:00

104 lines
3 KiB
TypeScript

// Module ID: 13073
// Function ID: 13074
// Name: ProtocolUtils
// Dependencies: [4959, 2]
// Module 13073 (ProtocolUtils)
import _modDef4959 from "module_4959" /* 4959 */;
const os = _modDef4959.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 = _modDef4959.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" !== _modDef4959.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 != _modDef4959.ua) {
const ua = _modDef4959.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 };