tauri: expose isTauri in utils to check if gb is running in tauri

environment
This commit is contained in:
Tor Hveem 2023-02-10 11:25:28 +01:00
parent e9a8387d7b
commit 8875e0604a
1 changed files with 5 additions and 0 deletions

View File

@ -28,6 +28,10 @@ weechat.factory('utils', function() {
return window.cordova !== undefined; return window.cordova !== undefined;
}; };
const _isTauri = window.__TAURI__ !== undefined;
var isTauri = function() {
return _isTauri;
}
// Inject a javascript (used by KaTeX) // Inject a javascript (used by KaTeX)
var inject_script = function(script_url) { var inject_script = function(script_url) {
@ -87,6 +91,7 @@ weechat.factory('utils', function() {
getClassStyle: getClassStyle, getClassStyle: getClassStyle,
isMobileUi: isMobileUi, isMobileUi: isMobileUi,
isCordova: isCordova, isCordova: isCordova,
isTauri: isTauri,
inject_script: inject_script, inject_script: inject_script,
inject_css: inject_css, inject_css: inject_css,
hexStringToByte: hexStringToByte, hexStringToByte: hexStringToByte,