use of com.intellij.ide.browsers.WebBrowser in project intellij-plugins by JetBrains.
the class FlexLauncherDialog method getLauncherParameters.
public LauncherParameters getLauncherParameters() {
final LauncherParameters.LauncherType launcherType = myPlayerRadioButton.isSelected() ? LauncherParameters.LauncherType.Player : myBrowserRadioButton.isSelected() ? LauncherParameters.LauncherType.Browser : LauncherParameters.LauncherType.OSDefault;
final WebBrowser browser = myBrowserSelector.getSelected();
final WebBrowser notNullBrowser = browser == null ? WebBrowserManager.getInstance().getFirstBrowser(BrowserFamily.FIREFOX) : browser;
final String playerPath = FileUtil.toSystemIndependentName(myPlayerTextWithBrowse.getText().trim());
final boolean isNewPlayerInstance = myNewPlayerInstanceCheckBox.isSelected();
return new LauncherParameters(launcherType, notNullBrowser, playerPath, isNewPlayerInstance);
}
use of com.intellij.ide.browsers.WebBrowser in project intellij-plugins by JetBrains.
the class KarmaDebugBrowserSelector method selectDebugEngine.
@Nullable
public DebuggableWebBrowser selectDebugEngine() {
List<DebuggableWebBrowser> allDebuggableActiveBrowsers = toDebuggableWebBrowsers(WebBrowserManager.getInstance().getActiveBrowsers());
List<DebuggableWebBrowser> capturedDebuggableActiveBrowsers = filterCaptured(allDebuggableActiveBrowsers);
if (capturedDebuggableActiveBrowsers.size() == 1) {
DebuggableWebBrowser debuggableWebBrowser = capturedDebuggableActiveBrowsers.get(0);
setWebBrowserToReuse(null);
return ObjectUtils.assertNotNull(debuggableWebBrowser);
}
WebBrowser browserToReuse = getWebBrowserToReuse();
if (browserToReuse != null) {
DebuggableWebBrowser debuggableBrowser = DebuggableWebBrowser.create(browserToReuse);
if (debuggableBrowser != null) {
return debuggableBrowser;
}
}
if (capturedDebuggableActiveBrowsers.isEmpty() && allDebuggableActiveBrowsers.size() == 1) {
return ObjectUtils.assertNotNull(allDebuggableActiveBrowsers.get(0));
}
printSupportedBrowsers(allDebuggableActiveBrowsers, capturedDebuggableActiveBrowsers);
return null;
}
use of com.intellij.ide.browsers.WebBrowser in project intellij-plugins by JetBrains.
the class KarmaDebugProgramRunner method createDescriptor.
@NotNull
private static RunContentDescriptor createDescriptor(@NotNull ExecutionEnvironment environment, @NotNull ExecutionResult executionResult, @NotNull KarmaConsoleView consoleView, @NotNull KarmaServer karmaServer, @NotNull DebuggableWebBrowser debuggableWebBrowser) throws ExecutionException {
Url url = Urls.newFromEncoded(karmaServer.formatUrl("/"));
DebuggableFileFinder fileFinder = getDebuggableFileFinder(karmaServer);
XDebugSession session = XDebuggerManager.getInstance(environment.getProject()).startSession(environment, new XDebugProcessStarter() {
@Override
@NotNull
public XDebugProcess start(@NotNull XDebugSession session) {
JavaScriptDebugEngine debugEngine = debuggableWebBrowser.getDebugEngine();
WebBrowser browser = debuggableWebBrowser.getWebBrowser();
JavaScriptDebugProcess<? extends VmConnection> debugProcess = debugEngine.createDebugProcess(session, browser, fileFinder, url, executionResult, true);
debugProcess.addFirstLineBreakpointPattern("\\.browserify$");
debugProcess.setElementsInspectorEnabled(false);
debugProcess.setConsoleMessagesSupportEnabled(false);
debugProcess.setLayouter(consoleView.createDebugLayouter(debugProcess));
Alarm alarm = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, consoleView);
alarm.addRequest(() -> {
resumeTestRunning(executionResult.getProcessHandler());
Disposer.dispose(alarm);
}, 2000);
return debugProcess;
}
});
return session.getRunContentDescriptor();
}
use of com.intellij.ide.browsers.WebBrowser in project intellij-plugins by JetBrains.
the class JstdDebugBrowserInfo method build.
@Nullable
public static JstdDebugBrowserInfo build(@NotNull JstdServer server, @NotNull JstdRunSettings runSettings) {
Collection<JstdBrowserInfo> capturedBrowsers = server.getCapturedBrowsers();
List<JstdDebugBrowserInfo> debugBrowserInfos = new SmartList<>();
for (JstdBrowserInfo browserInfo : capturedBrowsers) {
Pair<JavaScriptDebugEngine, WebBrowser> engine = JavaScriptDebugEngine.Companion.findByBrowserIdOrName(browserInfo.getName());
if (engine != null) {
debugBrowserInfos.add(new JstdDebugBrowserInfo(engine, server.getSettings(), browserInfo));
}
}
if (debugBrowserInfos.size() == 1) {
return debugBrowserInfos.get(0);
}
if (debugBrowserInfos.size() > 1) {
WebBrowser preferredBrowser = runSettings.getPreferredDebugBrowser();
for (JstdDebugBrowserInfo info : debugBrowserInfos) {
if (preferredBrowser.equals(info.getBrowser())) {
return info;
}
}
}
return null;
}
use of com.intellij.ide.browsers.WebBrowser in project intellij-plugins by JetBrains.
the class DartiumUtil method resetDartiumFlags.
public static void resetDartiumFlags() {
final WebBrowser dartium = getDartiumBrowser();
final BrowserSpecificSettings browserSpecificSettings = dartium == null ? null : dartium.getSpecificSettings();
if (!(browserSpecificSettings instanceof ChromeSettings))
return;
final Map<String, String> envVars = browserSpecificSettings.getEnvironmentVariables();
setDartFlagState(envVars, ENABLE_ASYNC_OPTION, false);
setDartFlagState(envVars, CHECKED_MODE_OPTION, true);
}
Aggregations