Skip to content

Commit

Permalink
#1327 A "Chrome Debug" session can now be started even when a chrome …
Browse files Browse the repository at this point in the history
…window is already open
  • Loading branch information
Si-So authored and mickaelistria committed Sep 11, 2023
1 parent 53659fc commit 6c5dbcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
import org.eclipse.wildwebdeveloper.Activator;
import org.eclipse.wildwebdeveloper.debug.AbstractHTMLDebugDelegate;
import org.eclipse.wildwebdeveloper.debug.LaunchConstants;
import org.eclipse.wildwebdeveloper.debug.MessageUtils;
import org.eclipse.wildwebdeveloper.debug.Messages;

import com.google.gson.JsonObject;

Expand All @@ -54,6 +52,10 @@ public class ChromeRunDAPDebugDelegate extends AbstractHTMLDebugDelegate {
public static final String RUNTIME_EXECUTABLE = "runtimeExecutable";
public static final String URL = "url";
private static final String SOURCE_MAPS = "sourceMaps";
public static final String TYPE = "type";
public static final String CHROME = "chrome";
public static final String REQUEST = "request";
public static final String LAUNCH = "launch";

@Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
Expand Down Expand Up @@ -108,14 +110,9 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun

param.put(SOURCE_MAPS, true);

// Let user point to the location of their Chrome executable
String chromeLocation = findChromeLocation(configuration);
File executable = chromeLocation != null && !chromeLocation.isBlank() ? new File(chromeLocation) : null;
if (executable == null || !executable.isAbsolute() || !executable.canExecute()) {
MessageUtils.showBrowserLocationsConfigurationError(Activator.getShell(), configuration, mode, Messages.RuntimeExecutable_Chrome, true);
return;
}
param.put(RUNTIME_EXECUTABLE, chromeLocation);
//Tell the debugger that we want to start a chrome debug session
param.put(TYPE, CHROME);
param.put(REQUEST, LAUNCH);

if (configuration.getAttribute(VERBOSE, false)) {
param.put(TRACE, VERBOSE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
setTabs(new ILaunchConfigurationTab[] {
new RunChromeDebugTab(),
new EnvironmentTab(),
new ChromeExecutableTab(),
new DSPOverrideSettingsTab(),
new CommonTab()
});
Expand Down

0 comments on commit 6c5dbcb

Please sign in to comment.