| 41 | namespace HyperlinkHelper |
| 42 | { |
| 43 | void OpenUrl(const std::string &url) |
| 44 | { |
| 45 | /* |
| 46 | bool isAbsoluteUrl = fplus::is_prefix_of(std::string("http"), url); |
| 47 | if (!isAbsoluteUrl) |
| 48 | return; |
| 49 | */ |
| 50 | #if defined(__EMSCRIPTEN__) |
| 51 | std::string js_command = "window.open(\"" + url + "\");"; |
| 52 | emscripten_run_script(js_command.c_str()); |
| 53 | #elif defined(_WIN32) |
| 54 | ShellExecuteA( NULL, "open", url.c_str(), NULL, NULL, SW_SHOWNORMAL ); |
| 55 | #elif defined(TARGET_OS_MAC) |
| 56 | std::string cmd = std::string("open ") + url.c_str(); |
| 57 | system(cmd.c_str()); |
| 58 | #endif |
| 59 | |
| 60 | } |
| 61 | |
| 62 | } |
no test coverage detected