mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 20:33:52 +00:00
Support opening web pages on emscripten.
This commit is contained in:
parent
7552341ff0
commit
5940af8995
@ -1,6 +1,8 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# include <shellapi.h>
|
# include <shellapi.h>
|
||||||
|
#elif defined __EMSCRIPTEN__
|
||||||
|
# include <emscripten.h>
|
||||||
#else
|
#else
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
@ -19,6 +21,8 @@ void OpenWebpage( const char* url )
|
|||||||
char buf[1024];
|
char buf[1024];
|
||||||
sprintf( buf, "open %s", url );
|
sprintf( buf, "open %s", url );
|
||||||
system( buf );
|
system( buf );
|
||||||
|
#elif defined __EMSCRIPTEN__
|
||||||
|
EM_ASM( { window.open( UTF8ToString( $0 ), '_blank' ) }, url );
|
||||||
#else
|
#else
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
sprintf( buf, "xdg-open %s", url );
|
sprintf( buf, "xdg-open %s", url );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user