chore: Revert linux openExternal fix for additional tests
This commit is contained in:
1 file changed
+4
-16
@@ -5,7 +5,7 @@ const boundaryCli = require('../cli/index.js');
|
|||||||
const sessionManager = require('../services/session-manager.js');
|
const sessionManager = require('../services/session-manager.js');
|
||||||
const runtimeSettings = require('../services/runtime-settings.js');
|
const runtimeSettings = require('../services/runtime-settings.js');
|
||||||
const sanitizer = require('../utils/sanitizer.js');
|
const sanitizer = require('../utils/sanitizer.js');
|
||||||
const { isMac, isWindows, isLinux } = require('../helpers/platform.js');
|
const { isMac, isWindows } = require('../helpers/platform.js');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current runtime origin, which is used by the main thread to
|
* Returns the current runtime origin, which is used by the main thread to
|
||||||
@@ -39,22 +39,10 @@ handle('openExternal', async (href) => {
|
|||||||
href.startsWith('http://localhost') || href.startsWith('http://127.0.0.1');
|
href.startsWith('http://localhost') || href.startsWith('http://127.0.0.1');
|
||||||
if (isSecure || isLocalhost || isDev) {
|
if (isSecure || isLocalhost || isDev) {
|
||||||
/**
|
/**
|
||||||
* Launch browser to display documentation and to support arbitrary OIDC flows.
|
* Launch browser to display documentation and to support arbitrary OIDC flows
|
||||||
* The protocol is validated (see above).
|
* using openExternal. The protocol is validated (see above).
|
||||||
* In linux, launch application (xdg-open) does not launch browser window
|
|
||||||
* and fails silently. As a bypass, launch a new browser window attached
|
|
||||||
* to main window.
|
|
||||||
*/
|
*/
|
||||||
if (isLinux()) {
|
shell.openExternal(href); /* eng-disable OPEN_EXTERNAL_JS_CHECK */
|
||||||
const browserWindow = new BrowserWindow({
|
|
||||||
parent: BrowserWindow.getFocusedWindow(),
|
|
||||||
});
|
|
||||||
browserWindow.loadURL(href);
|
|
||||||
browserWindow.show();
|
|
||||||
} else {
|
|
||||||
// openExternal is necessary to open urls in Windows and MacOS
|
|
||||||
shell.openExternal(href); /* eng-disable OPEN_EXTERNAL_JS_CHECK */
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`URLs may only be opened over HTTPS in an external browser.
|
`URLs may only be opened over HTTPS in an external browser.
|
||||||
|
|||||||
Reference in new issue
Block a user