diff --git a/src/phoenix/shell.js b/src/phoenix/shell.js index 25751b2d0..efab286d9 100644 --- a/src/phoenix/shell.js +++ b/src/phoenix/shell.js @@ -515,6 +515,17 @@ Phoenix.app = { } return window.__TAURI__.tauri.invoke("zoom_window", {scaleFactor: scaleFactor}); }, + _openUrlInBrowserWin: function (url, browser) { + // private API for internal use only. May be removed at any time. + // Please use NodeUtils.openUrlInBrowser for a platform independent equivalent of this. + if(!Phoenix.isNativeApp){ + throw new Error("_openUrlInBrowserWin is not supported in browsers"); + } + if(Phoenix.platform !== "win") { + throw new Error("_openUrlInBrowserWin is only supported in windows"); + } + return window.__TAURI__.invoke('_open_url_in_browser_win', { url, browser }); + }, getApplicationSupportDirectory: Phoenix.VFS.getAppSupportDir, getExtensionsDirectory: Phoenix.VFS.getExtensionDir, getUserDocumentsDirectory: Phoenix.VFS.getUserDocumentsDirectory, diff --git a/src/utils/NodeUtils.js b/src/utils/NodeUtils.js index e9642b82e..a6cdcb3a3 100644 --- a/src/utils/NodeUtils.js +++ b/src/utils/NodeUtils.js @@ -75,6 +75,9 @@ define(function (require, exports, module) { if(!Phoenix.isNativeApp) { throw new Error("openUrlInBrowser not available in browser"); } + if(Phoenix.platform === "win") { + return Phoenix.app._openUrlInBrowserWin(url, browserName); + } return utilsConnector.execPeer("openUrlInBrowser", {url, browserName}); }