11 static const Platform qtDetectedPlatform = ([]() {
13 emscripten::val rawPlatform = emscripten::val::global(
"navigator")[
"platform"];
15 if (rawPlatform.call<
bool>(
"includes", emscripten::val(
"Mac")))
16 return Platform::MacOS;
17 if (rawPlatform.call<
bool>(
"includes", emscripten::val(
"iPhone"))
18 || rawPlatform.call<
bool>(
"includes", emscripten::val(
"iPad")))
20 if (rawPlatform.call<
bool>(
"includes", emscripten::val(
"Win32")))
21 return Platform::Windows;
22 if (rawPlatform.call<
bool>(
"includes", emscripten::val(
"Linux"))) {
23 emscripten::val uAgent = emscripten::val::global(
"navigator")[
"userAgent"];
24 if (uAgent.call<
bool>(
"includes", emscripten::val(
"Android")))
25 return Platform::Android;
26 return Platform::Linux;
28 return Platform::Generic;
30 return qtDetectedPlatform;