From 8875e0604a96084c5bb03e2511f0e4ae65f1b547 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Fri, 10 Feb 2023 11:25:28 +0100 Subject: [PATCH] tauri: expose isTauri in utils to check if gb is running in tauri environment --- src/js/utils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/utils.js b/src/js/utils.js index 8aa61e6..5505564 100644 --- a/src/js/utils.js +++ b/src/js/utils.js @@ -28,6 +28,10 @@ weechat.factory('utils', function() { return window.cordova !== undefined; }; + const _isTauri = window.__TAURI__ !== undefined; + var isTauri = function() { + return _isTauri; + } // Inject a javascript (used by KaTeX) var inject_script = function(script_url) { @@ -87,6 +91,7 @@ weechat.factory('utils', function() { getClassStyle: getClassStyle, isMobileUi: isMobileUi, isCordova: isCordova, + isTauri: isTauri, inject_script: inject_script, inject_css: inject_css, hexStringToByte: hexStringToByte,