mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Chrome not found on Mac when launching React Native (WEB-27607)
This commit is contained in:
@@ -45,9 +45,18 @@ abstract class BrowserLauncher {
|
||||
|
||||
abstract fun browse(url: String, browser: WebBrowser? = null, project: Project? = null)
|
||||
|
||||
fun browseUsingPath(url: String?,
|
||||
browserPath: String? = null,
|
||||
browser: WebBrowser? = null,
|
||||
project: Project? = null,
|
||||
additionalParameters: Array<String> = ArrayUtil.EMPTY_STRING_ARRAY): Boolean {
|
||||
return browseUsingPath(url, browserPath, browser, project, false, additionalParameters)
|
||||
}
|
||||
|
||||
abstract fun browseUsingPath(url: String?,
|
||||
browserPath: String? = null,
|
||||
browser: WebBrowser? = null,
|
||||
project: Project? = null,
|
||||
openInNewWindow: Boolean = false,
|
||||
additionalParameters: Array<String> = ArrayUtil.EMPTY_STRING_ARRAY): Boolean
|
||||
}
|
||||
@@ -188,21 +188,33 @@ open class BrowserLauncherAppless : BrowserLauncher() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun browseUsingPath(url: String?, browserPath: String?, browser: WebBrowser?, project: Project?, additionalParameters: Array<String>): Boolean {
|
||||
override fun browseUsingPath(url: String?,
|
||||
browserPath: String?,
|
||||
browser: WebBrowser?,
|
||||
project: Project?,
|
||||
openInNewWindow: Boolean,
|
||||
additionalParameters: Array<String>): Boolean {
|
||||
var browserPathEffective = browserPath
|
||||
var launchTask: (() -> Unit)? = null
|
||||
if (browserPath == null && browser != null) {
|
||||
browserPathEffective = PathUtil.toSystemDependentName(browser.path)
|
||||
launchTask = { browseUsingPath(url, null, browser, project, additionalParameters) }
|
||||
launchTask = { browseUsingPath(url, null, browser, project, openInNewWindow, additionalParameters) }
|
||||
}
|
||||
return doLaunch(url, browserPathEffective, browser, project, additionalParameters, launchTask)
|
||||
return doLaunch(url, browserPathEffective, browser, project, openInNewWindow, additionalParameters, launchTask)
|
||||
}
|
||||
|
||||
private fun doLaunch(url: String?, browserPath: String?, browser: WebBrowser?, project: Project?, additionalParameters: Array<String>, launchTask: (() -> Unit)?): Boolean {
|
||||
private fun doLaunch(url: String?,
|
||||
browserPath: String?,
|
||||
browser: WebBrowser?,
|
||||
project: Project?,
|
||||
openInNewWindow: Boolean,
|
||||
additionalParameters: Array<String>,
|
||||
launchTask: (() -> Unit)?): Boolean {
|
||||
if (!checkPath(browserPath, browser, project, launchTask)) {
|
||||
return false
|
||||
}
|
||||
return doLaunch(url, BrowserUtil.getOpenBrowserCommand(browserPath!!, false), browser, project, additionalParameters, launchTask)
|
||||
return doLaunch(url, BrowserUtil.getOpenBrowserCommand(browserPath!!, openInNewWindow), browser, project, additionalParameters,
|
||||
launchTask)
|
||||
}
|
||||
|
||||
@Contract("null, _, _, _ -> false")
|
||||
|
||||
Reference in New Issue
Block a user