Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,301 @@
|
||||
/* Metro module 10714; source: modules/activities/native/createWebviewHtmlFile.tsx; dependencies: [5, 27, 477, 1279, 1216, 2] */
|
||||
function _fun82335(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10900:6, offset: 0x01ef3893, size: 186 bytes, params: 8, frame: 19
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
||||
const env0_4 = (require(27) /* metro dependency 27 */).NativeModules;
|
||||
const safeAreasUpdateListenerJs = function({iframeWindowVarName, isIframeLoadedVarName}) {
|
||||
return '\n function updateSafeAreaVars(insets) {\n var iframeDoc = ' + iframeWindowVarName + ".document;\n iframeDoc.documentElement.style.setProperty('--discord-safe-area-inset-left', `${insets.left}px`);\n iframeDoc.documentElement.style.setProperty('--discord-safe-area-inset-right', `${insets.right}px`);\n iframeDoc.documentElement.style.setProperty('--discord-safe-area-inset-top', `${insets.top}px`);\n iframeDoc.documentElement.style.setProperty('--discord-safe-area-inset-bottom', `${insets.bottom}px`);\n " + iframeWindowVarName + ".dispatchEvent(new Event('resize'));\n // Force redraw\n iframeDoc.documentElement.offsetHeight;\n }\n " + iframeWindowVarName + ".addEventListener('message', function (e) {\n const messageData = e.data;\n const {type, data} = messageData;\n if (type === 'safeAreaUpdateEvent') {\n const {insets} = data;\n if (" + isIframeLoadedVarName + ') {\n updateSafeAreaVars(insets);\n } else {\n ' + iframeWindowVarName + '.addEventListener("load", () => {\n updateSafeAreaVars(insets);\n });\n }\n }\n });\n';
|
||||
};
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/activities/native/createWebviewHtmlFile.tsx');
|
||||
exports.default = function() {
|
||||
return _createWebviewHtmlFile.apply(this, arguments);
|
||||
};
|
||||
exports.createInjectedJavascriptForIOS = createInjectedJavascriptForIOS;
|
||||
}
|
||||
|
||||
function _createWebviewHtmlFile() { // fn#82336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10900:1868, offset: 0x01ef394d, size: 50 bytes, params: 1, frame: 14
|
||||
return env0_3(_fun82338).apply(this, arguments);
|
||||
}
|
||||
|
||||
function safeAreaInitJs({insets, iframeWindowVarName, isIframeLoadedVarName}) { // fn#82340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10900:147, offset: 0x01ef3c2d, size: 133 bytes, params: 2, frame: 36
|
||||
const r0 = insets ?? ({'top': 0, 'bottom': 0, 'left': 0, 'right': 0});
|
||||
return '\n ' + iframeWindowVarName + '.addEventListener("load", () => {\n var iframeDoc = ' + iframeWindowVarName + ".document;\n iframeDoc.documentElement.style.setProperty('--discord-safe-area-inset-left', '" + r0.left + "px');\n iframeDoc.documentElement.style.setProperty('--discord-safe-area-inset-right', '" + r0.right + "px');\n iframeDoc.documentElement.style.setProperty('--discord-safe-area-inset-top', '" + r0.top + "px');\n iframeDoc.documentElement.style.setProperty('--discord-safe-area-inset-bottom', '" + r0.bottom + "px');\n " + isIframeLoadedVarName + ' = true;\n });\n';
|
||||
}
|
||||
|
||||
function createInjectedJavascriptForIOS(a0) { // fn#82343, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10900:4771, offset: 0x01ef3d04, size: 98 bytes, params: 2, frame: 16
|
||||
return '\nvar iframeWindow = window;\nvar isIframeLoaded = false;\n' + safeAreaInitJs({'insets': null,
|
||||
'iframeWindowVarName': 'iframeWindow', 'isIframeLoadedVarName': 'isIframeLoaded',
|
||||
insets: a0}) + '\n' + safeAreasUpdateListenerJs({'iframeWindowVarName': 'iframeWindow',
|
||||
'isIframeLoadedVarName': 'isIframeLoaded'}) + '\n';
|
||||
}
|
||||
|
||||
async function _fun82338({iFrameUri, iFrameSandboxAttributes, referrerPolicy, insets, messageForDisallowedNavigationError}) { // fn#82338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10900:1935, offset: 0x01ef3993, size: 346 bytes, params: 2, frame: 23
|
||||
var r2;
|
||||
var binding;
|
||||
var binding2;
|
||||
var property;
|
||||
var value7;
|
||||
var isAndroid;
|
||||
var isAndroid2;
|
||||
var DCDFileManager;
|
||||
var writeFile;
|
||||
var value8;
|
||||
var value9;
|
||||
var value10;
|
||||
var binding3;
|
||||
var value11;
|
||||
var value12;
|
||||
var binding4;
|
||||
var value13;
|
||||
var value14;
|
||||
var value15;
|
||||
var value16;
|
||||
var error;
|
||||
if (false) {
|
||||
return undefined;
|
||||
}
|
||||
await undefined;
|
||||
if (false) {
|
||||
return undefined;
|
||||
}
|
||||
const value5 = _fun82339({iFrameUri: iFrameUri, iFrameSandboxAttributes: iFrameSandboxAttributes,
|
||||
referrerPolicy: referrerPolicy, insets: insets,
|
||||
messageForDisallowedNavigationError: messageForDisallowedNavigationError});
|
||||
try {
|
||||
binding = env2_0;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
binding2 = env2_2;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
property = binding2[2];
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
value7 = binding(property);
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
isAndroid = value7.isAndroid;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
isAndroid2 = Reflect.apply(isAndroid, value7, []);
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
if (isAndroid2) {
|
||||
try {
|
||||
binding = env2_1;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
binding3 = env2_2;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
property = binding3[3];
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
value11 = binding(property);
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
value12 = value11 == null;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
if (value12) {
|
||||
r2 = value;
|
||||
} else {
|
||||
try {
|
||||
binding = env2_1;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
binding4 = env2_2;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
property = binding4[3];
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
value13 = binding(property);
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
writeFile = value13.writeFile;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
value14 = Reflect.apply(writeFile, value13, ['cache', 'discord_activity_data/activity.html', value5,
|
||||
'utf8']);
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
r2 = value14;
|
||||
}
|
||||
await r2;
|
||||
try {
|
||||
value15 = undefined;
|
||||
value16 = false;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
if (value16) {
|
||||
return value15;
|
||||
}
|
||||
return value15;
|
||||
}
|
||||
try {
|
||||
binding = env2_4;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
DCDFileManager = binding.DCDFileManager;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
writeFile = DCDFileManager.writeFile;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
value8 = Reflect.apply(writeFile, DCDFileManager, ['cache', 'discord_activity_data/activity.html', value5,
|
||||
'utf8']);
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
await value8;
|
||||
try {
|
||||
value9 = undefined;
|
||||
value10 = false;
|
||||
} catch (error) {
|
||||
binding = env2_1;
|
||||
value = binding(env2_2[4]);
|
||||
value.captureException(error);
|
||||
return null;
|
||||
}
|
||||
if (value10) {
|
||||
}
|
||||
return value9;
|
||||
}
|
||||
|
||||
function _fun82339({iFrameUri, iFrameSandboxAttributes, referrerPolicy, insets, messageForDisallowedNavigationError}) { // fn#82339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10900:2097, offset: 0x01ef3aed, size: 320 bytes, params: 2, frame: 29
|
||||
var r7;
|
||||
var r8;
|
||||
var value4;
|
||||
let value = environment.__proto__.__proto__.__proto__;
|
||||
let binding = env3_0;
|
||||
const isAndroid2 = binding(env3_2[2]).isAndroid();
|
||||
const value3 = '';
|
||||
if (isAndroid2) {
|
||||
binding = env3_5;
|
||||
value4 = binding({'insets': null, 'iframeWindowVarName': 'iframeWindow',
|
||||
'isIframeLoadedVarName': 'isIframeLoaded',
|
||||
insets: insets});
|
||||
binding = env3_6;
|
||||
value = binding({'iframeWindowVarName': 'iframeWindow', 'isIframeLoadedVarName': 'isIframeLoaded'});
|
||||
value = '\n <script type="text/javascript">\n var iframe = document.getElementById("activityFrame");\n var iframeWindow = iframe.contentWindow;\n var isIframeLoaded = false;\n ' + value4 + '\n ' + value + '\n </script>\n ';
|
||||
r7 = value;
|
||||
} else {
|
||||
r7 = value3;
|
||||
}
|
||||
if (messageForDisallowedNavigationError != null) {
|
||||
value = '\n ' + 'iframeWindow' + ".addEventListener('beforeunload', function (e) {\n window.ReactNativeWebView.postMessage('" + messageForDisallowedNavigationError + "');\n e.preventDefault();\n });\n";
|
||||
value = '\n <script type="text/javascript">\n var iframe = document.getElementById("activityFrame");\n var iframeWindow = iframe.contentWindow;\n ' + value + '\n </script>\n ';
|
||||
r8 = value;
|
||||
} else {
|
||||
r8 = value3;
|
||||
}
|
||||
return '\n <html>\n <head>\n <style>\n body {\n padding: 0;\n margin: 0;\n width: 100vw;\n min-height: 100vh; /* This keeps a small white gap at the bottom of the screen, the options below help prevent this. */\n min-height: -moz-available; /* See: https://ilxanlar.medium.com/you-shouldnt-rely-on-css-100vh-and-here-s-why-1b4721e74487 for more info */\n min-height: -webkit-fill-available;\n min-height: fill-available;\n }\n </style>\n <meta\n name="viewport"\n content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover"\n />\n </head>\n <body>\n <script type="text/javascript">\n window.addEventListener(\'message\', e => {\n window.ReactNativeWebView.postMessage(JSON.stringify(e.data));\n });\n </script>\n <iframe id="activityFrame" width="100%" height="100%" src="' + iFrameUri + '" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen sandbox="' + iFrameSandboxAttributes + '" referrerPolicy="' + referrerPolicy + '">\n </iframe>\n ' + r7 + '\n ' + r8 + '\n </body>\n </html>\n';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user