decord/source/utils/web/ProtocolUtils.tsx

95 lines
2.4 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 12387
// Function ID: 96318
2026-07-20 16:05:17 +00:00
// Name: launchChrome
2026-07-23 10:11:24 +00:00
// Dependencies: [4450, 2]
2026-07-20 16:05:17 +00:00
2026-07-24 07:16:23 +00:00
// Module 12387 (launchChrome)
2026-07-23 10:11:24 +00:00
import { os } from "capitalize";
2026-07-20 16:05:17 +00:00
function launchChrome(href) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
2026-07-20 16:05:17 +00:00
function handleBlur() {
2026-07-23 10:11:24 +00:00
let c1 = true;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = false;
2026-07-20 16:05:17 +00:00
const listener = window.addEventListener("blur", handleBlur);
location.href = href;
const timerId = setTimeout(() => {
const removed = window.removeEventListener("blur", handleBlur);
2026-07-23 10:11:24 +00:00
callback(c1);
2026-07-20 16:05:17 +00:00
}, 1000);
}
function launchFirefox(str) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
2026-07-20 16:05:17 +00:00
if (str.startsWith("discord:")) {
const _document = document;
if (null == body) {
const _process3 = process;
2026-07-23 10:11:24 +00:00
return process.nextTick(() => callback(false));
2026-07-20 16:05:17 +00:00
} else {
const _document2 = document;
const element = <iframe />;
obj.appendChild(element);
if (null != element.contentWindow) {
element.contentWindow.location.href = str;
}
const _process2 = process;
2026-07-23 10:11:24 +00:00
process.nextTick(() => callback(true));
2026-07-20 16:05:17 +00:00
const _window = window;
const timerId = window.setTimeout(() => {
let parentElement;
if (null != element) {
parentElement = element.parentElement;
}
let tmp3 = null;
if (null != parentElement) {
tmp3 = parentElement;
}
if (null !== tmp3) {
body.removeChild(element);
}
}, 1000);
}
2026-07-23 10:11:24 +00:00
obj = body;
2026-07-20 16:05:17 +00:00
} else {
const _location = location;
location.href = str;
const _process = process;
2026-07-23 10:11:24 +00:00
return process.nextTick(() => callback(true));
2026-07-20 16:05:17 +00:00
}
}
function launchSteam(arg0, arg1) {
arg1(false);
}
function launchMobile(href) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
2026-07-20 16:05:17 +00:00
location.href = href;
2026-07-23 10:11:24 +00:00
process.nextTick(() => callback(true));
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj = {};
2026-07-20 16:05:17 +00:00
let family;
if (null != os) {
family = os.family;
}
if ("Android" !== family) {
2026-07-23 10:11:24 +00:00
const os2 = require("capitalize").os;
2026-07-20 16:05:17 +00:00
let family1;
if (null != os2) {
family1 = os2.family;
}
if ("iOS" !== family1) {
2026-07-23 10:11:24 +00:00
if ("Gecko" === require("capitalize").layout) {
2026-07-20 16:05:17 +00:00
launchChrome = launchFirefox;
2026-07-23 10:11:24 +00:00
} else if (null != require("capitalize").ua) {
const ua = require("capitalize").ua;
2026-07-20 16:05:17 +00:00
if (-1 !== ua.indexOf("Valve Steam GameOverlay")) {
launchChrome = launchSteam;
}
}
}
obj.launch = launchChrome;
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("utils/web/ProtocolUtils.tsx");
2026-07-20 16:05:17 +00:00
exports.default = obj;
}
launchChrome = launchMobile;