Implement openBrowser for wasm

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-07-05 16:45:02 +01:00
parent c14eee850b
commit 74b41e1713
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
5 changed files with 28 additions and 10 deletions

View file

@ -52,6 +52,10 @@
# include <unistd.h>
#endif
#ifdef DISTRHO_OS_WASM
# include <emscripten/emscripten.h>
#endif
const std::string CARDINAL_VERSION = "22.06";
namespace rack {
@ -268,6 +272,17 @@ void saveAsDialogUncompressed()
#endif
}
void openBrowser(const std::string& url)
{
#ifdef DISTRHO_OS_WASM
EM_ASM({
window.open(UTF8ToString($0), '_blank');
}, url.c_str());
#else
patchUtils::openBrowser(url);
#endif
}
}
void async_dialog_filebrowser(const bool saving,