diff --git a/lib/controllers/debug-controller.ts b/lib/controllers/debug-controller.ts index 0b86d66c2b..3292870853 100644 --- a/lib/controllers/debug-controller.ts +++ b/lib/controllers/debug-controller.ts @@ -157,7 +157,7 @@ export class DebugController extends EventEmitter implements IDebugController { this.emit(DEBUGGER_ATTACHED_EVENT_NAME, debugInformation); } - this.$logger.info(`To start debugging, open the following URL in Chrome:${EOL}${debugInformation.url}${EOL}`.cyan); + this.$logger.info(`To start debugging, open the following URL in Chrome:${EOL}${debugInformation.url}${EOL}`.green); } return debugInformation; diff --git a/lib/services/debug-service-base.ts b/lib/services/debug-service-base.ts index 4b6a9ea097..48e0eadc98 100644 --- a/lib/services/debug-service-base.ts +++ b/lib/services/debug-service-base.ts @@ -39,17 +39,18 @@ export abstract class DebugServiceBase extends EventEmitter implements IDeviceDe // Using the actual commit will result in 404 error in the remote serve. const commitSHA = debugOptions.devToolsCommit || "02e6bde1bbe34e43b309d4ef774b1168d25fd024"; - let chromeDevToolsPrefix = `chrome-devtools://devtools/remote/serve_file/@${commitSHA}`; + const devToolsProtocol = `devtools`; + let chromeDevToolsPrefix = `${devToolsProtocol}://devtools/remote/serve_file/@${commitSHA}`; if (debugOptions.useBundledDevTools === undefined || debugOptions.useBundledDevTools) { - chromeDevToolsPrefix = "chrome-devtools://devtools/bundled"; + chromeDevToolsPrefix = `${devToolsProtocol}://devtools/bundled`; } if (debugOptions.useHttpUrl) { chromeDevToolsPrefix = `https://chrome-devtools-frontend.appspot.com/serve_file/@${commitSHA}`; } - const chromeUrl = `${chromeDevToolsPrefix}/inspector.html?experiments=true&ws=localhost:${port}`; + const chromeUrl = `${chromeDevToolsPrefix}/inspector.html?ws=localhost:${port}`; return chromeUrl; } } diff --git a/lib/services/ios-device-debug-service.ts b/lib/services/ios-device-debug-service.ts index 81a3bd3f88..6a455c6d82 100644 --- a/lib/services/ios-device-debug-service.ts +++ b/lib/services/ios-device-debug-service.ts @@ -32,8 +32,8 @@ export class IOSDeviceDebugService extends DebugServiceBase implements IDeviceDe @performanceLog() public async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise { - const result: IDebugResultInfo = { debugUrl: null }; await this.validateOptions(debugOptions); + const result: IDebugResultInfo = { debugUrl: null }; result.debugUrl = await this.wireDebuggerClient(debugData, debugOptions); diff --git a/test/services/android-device-debug-service.ts b/test/services/android-device-debug-service.ts index 438fa77c5e..1bb12b73aa 100644 --- a/test/services/android-device-debug-service.ts +++ b/test/services/android-device-debug-service.ts @@ -55,7 +55,7 @@ describe("androidDeviceDebugService", () => { { scenarioName: "useBundledDevTools and useHttpUrl are not passed", debugOptions: {}, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, }, // When useBundledDevTools is true @@ -64,7 +64,7 @@ describe("androidDeviceDebugService", () => { debugOptions: { useBundledDevTools: true }, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "useBundledDevTools is true and useHttpUrl is false", @@ -72,7 +72,7 @@ describe("androidDeviceDebugService", () => { useBundledDevTools: true, useHttpUrl: false }, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "useBundledDevTools is true and useHttpUrl is true", @@ -80,7 +80,7 @@ describe("androidDeviceDebugService", () => { useBundledDevTools: true, useHttpUrl: true }, - expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, // When useBundledDevTools is false @@ -89,7 +89,7 @@ describe("androidDeviceDebugService", () => { debugOptions: { useBundledDevTools: false }, - expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "useBundledDevTools is false and useHttpUrl is false", @@ -97,7 +97,7 @@ describe("androidDeviceDebugService", () => { useBundledDevTools: false, useHttpUrl: false }, - expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "useBundledDevTools is false and useHttpUrl is true", @@ -105,7 +105,7 @@ describe("androidDeviceDebugService", () => { useBundledDevTools: false, useHttpUrl: true }, - expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, // When useBundledDevTools is not passed @@ -114,14 +114,14 @@ describe("androidDeviceDebugService", () => { debugOptions: { useHttpUrl: false }, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "useBundledDevTools is not passed and useHttpUrl is true", debugOptions: { useHttpUrl: true }, - expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, // devToolsCommit tests @@ -130,12 +130,12 @@ describe("androidDeviceDebugService", () => { debugOptions: { useBundledDevTools: false }, - expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "devToolsCommit is disregarded when useBundledDevTools is not passed", debugOptions: {}, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "devToolsCommit is set to passed value when useBundledDevTools is set to false", @@ -143,7 +143,7 @@ describe("androidDeviceDebugService", () => { useBundledDevTools: false, devToolsCommit: customDevToolsCommit }, - expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${customDevToolsCommit}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/remote/serve_file/@${customDevToolsCommit}/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "devToolsCommit is set to passed value when useHttpUrl is set to true", @@ -151,7 +151,7 @@ describe("androidDeviceDebugService", () => { useHttpUrl: true, devToolsCommit: customDevToolsCommit }, - expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${customDevToolsCommit}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${customDevToolsCommit}/inspector.html?ws=localhost:${expectedPort}`, } ]; diff --git a/test/services/ios-device-debug-service.ts b/test/services/ios-device-debug-service.ts index cff0409d54..ea8818d3d0 100644 --- a/test/services/ios-device-debug-service.ts +++ b/test/services/ios-device-debug-service.ts @@ -67,7 +67,7 @@ describe("iOSDeviceDebugService", () => { { scenarioName: "useBundledDevTools and useHttpUrl are not passed", debugOptions: {}, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, }, // When useBundledDevTools is true @@ -76,7 +76,7 @@ describe("iOSDeviceDebugService", () => { debugOptions: { useBundledDevTools: true }, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "useBundledDevTools is true and useHttpUrl is false", @@ -84,7 +84,7 @@ describe("iOSDeviceDebugService", () => { useBundledDevTools: true, useHttpUrl: false }, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "useBundledDevTools is true and useHttpUrl is true", @@ -92,7 +92,7 @@ describe("iOSDeviceDebugService", () => { useBundledDevTools: true, useHttpUrl: true }, - expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, // When useBundledDevTools is false @@ -101,7 +101,7 @@ describe("iOSDeviceDebugService", () => { debugOptions: { useBundledDevTools: false }, - expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "useBundledDevTools is false and useHttpUrl is false", @@ -109,7 +109,7 @@ describe("iOSDeviceDebugService", () => { useBundledDevTools: false, useHttpUrl: false }, - expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "useBundledDevTools is false and useHttpUrl is true", @@ -117,7 +117,7 @@ describe("iOSDeviceDebugService", () => { useBundledDevTools: false, useHttpUrl: true }, - expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, // When useBundledDevTools is not passed @@ -126,14 +126,14 @@ describe("iOSDeviceDebugService", () => { debugOptions: { useHttpUrl: false }, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "useBundledDevTools is not passed and useHttpUrl is true", debugOptions: { useHttpUrl: true }, - expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, // devToolsCommit tests @@ -142,14 +142,14 @@ describe("iOSDeviceDebugService", () => { debugOptions: { useBundledDevTools: false }, - expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "devToolsCommit is disregarded when useBundledDevTools is not passed", debugOptions: { devToolsCommit: customDevToolsCommit }, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "devToolsCommit is set to passed value when useBundledDevTools is set to false", @@ -157,7 +157,7 @@ describe("iOSDeviceDebugService", () => { useBundledDevTools: false, devToolsCommit: customDevToolsCommit }, - expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${customDevToolsCommit}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/remote/serve_file/@${customDevToolsCommit}/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "devToolsCommit is set to passed value when useHttpUrl is set to true", @@ -165,7 +165,7 @@ describe("iOSDeviceDebugService", () => { useHttpUrl: true, devToolsCommit: customDevToolsCommit }, - expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${customDevToolsCommit}/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${customDevToolsCommit}/inspector.html?ws=localhost:${expectedPort}`, }, { scenarioName: "devToolsCommit is disregarded when useBundledDevTools is set to true", @@ -173,7 +173,7 @@ describe("iOSDeviceDebugService", () => { useBundledDevTools: true, devToolsCommit: customDevToolsCommit }, - expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`, + expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`, } ];