Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1327 A "Chrome Debug" session can now be started even when a chrome window is already open #1328

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading