Skip to content

Commit 3bba1eb

Browse files
authored
Add debugger query parameter, disables debugger when set to false (#3787)
1 parent 624846d commit 3bba1eb

16 files changed

+148
-45
lines changed

packages/wrangler-devtools/patches/0001-Add-README-detailing-the-setup-process.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From b2985a087935838fdf6a6f0dba21afed484849c7 Mon Sep 17 00:00:00 2001
1+
From 085ba88402c95c0c110c77da1cdf23c0e7ccf0ab Mon Sep 17 00:00:00 2001
22
From: Samuel Macleod <[email protected]>
33
Date: Wed, 11 Jan 2023 17:46:48 +0000
4-
Subject: [PATCH 01/15] Add README detailing the setup process
4+
Subject: [PATCH 01/16] Add README detailing the setup process
55

66
---
77
README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -74,5 +74,5 @@ index 8a057be23c..4e009509b2 100644
7474

7575
<!-- [START badges] -->
7676
--
77-
2.39.2 (Apple Git-143)
77+
2.41.0
7878

packages/wrangler-devtools/patches/0002-Support-viewing-files-over-the-network.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From cc7b688a2427d7506a2f4111887a5e243fb841d4 Mon Sep 17 00:00:00 2001
1+
From ae9408ae42966da4f8e34a9add5c9ee641e1afa1 Mon Sep 17 00:00:00 2001
22
From: Samuel Macleod <[email protected]>
33
Date: Thu, 12 Jan 2023 15:33:43 +0000
4-
Subject: [PATCH 02/15] Support viewing files over the network
4+
Subject: [PATCH 02/16] Support viewing files over the network
55

66
---
77
front_end/core/sdk/Target.ts | 4 ++++
@@ -93,5 +93,5 @@ index ac0d4aaf68..29c726e185 100644
9393
]
9494
}
9595
--
96-
2.39.2 (Apple Git-143)
96+
2.41.0
9797

packages/wrangler-devtools/patches/0003-Show-fallback-image-on-Safari.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From a742a62c90c73c8c7e766eaaad9003200a447729 Mon Sep 17 00:00:00 2001
1+
From 3e732ac51f1cc473f5dea7224b3c5f2978a82956 Mon Sep 17 00:00:00 2001
22
From: Samuel Macleod <[email protected]>
33
Date: Mon, 16 Jan 2023 16:51:11 +0000
4-
Subject: [PATCH 03/15] Show fallback image on Safari
4+
Subject: [PATCH 03/16] Show fallback image on Safari
55

66
---
77
config/gni/devtools_grd_files.gni | 1 +
@@ -1815,5 +1815,5 @@ index 1edaec9604..945aa6d816 100644
18151815
+</script>
18161816
<body class="undocked" id="-blink-dev-tools">
18171817
--
1818-
2.39.2 (Apple Git-143)
1818+
2.41.0
18191819

packages/wrangler-devtools/patches/0004-Support-previewing-subrequest-responses.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 6c4581cd2e985e8e94aa3c9091faec45743da6e4 Mon Sep 17 00:00:00 2001
1+
From 2b46e6f3c86723ff2c0729ff9dee507347a07a75 Mon Sep 17 00:00:00 2001
22
From: bcoll <[email protected]>
33
Date: Mon, 16 Jan 2023 14:26:52 +0000
4-
Subject: [PATCH 04/15] Support previewing subrequest responses
4+
Subject: [PATCH 04/16] Support previewing subrequest responses
55

66
---
77
front_end/core/sdk/NetworkManager.ts | 9 +++++++--
@@ -61,5 +61,5 @@ index 213ca7fecd..ef5c568e96 100644
6161
import '../../panels/js_profiler/js_profiler-meta.js';
6262

6363
--
64-
2.39.2 (Apple Git-143)
64+
2.41.0
6565

packages/wrangler-devtools/patches/0005-Better-Firefox-support-for-network-tab.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From b91cdddb4b2576149ba2c184f011073140f16e9b Mon Sep 17 00:00:00 2001
1+
From c19d1d618c1ca839dd662e4dbd9b3fd6d1aa65e3 Mon Sep 17 00:00:00 2001
22
From: Samuel Macleod <[email protected]>
33
Date: Thu, 19 Jan 2023 15:47:52 +0000
4-
Subject: [PATCH 05/15] Better Firefox support for network tab
4+
Subject: [PATCH 05/16] Better Firefox support for network tab
55

66
---
77
front_end/entrypoints/js_app/js_app.ts | 2 ++
@@ -45,5 +45,5 @@ index a7ec8ccf32..fc80d2769d 100644
4545
return;
4646
}
4747
--
48-
2.39.2 (Apple Git-143)
48+
2.41.0
4949

packages/wrangler-devtools/patches/0006-DEVX-292-Remove-unsupported-network-UI.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 1a267cd3d143892fb0886907a75e3eb295b5b150 Mon Sep 17 00:00:00 2001
1+
From c8bc70352e561fdf6f004e0b3904a16d468d3690 Mon Sep 17 00:00:00 2001
22
From: bcoll <[email protected]>
33
Date: Mon, 16 Jan 2023 15:43:50 +0000
4-
Subject: [PATCH 06/15] DEVX-292 Remove unsupported network UI
4+
Subject: [PATCH 06/16] DEVX-292 Remove unsupported network UI
55

66
---
77
front_end/panels/network/NetworkPanel.ts | 35 ------------------------
@@ -75,5 +75,5 @@ index 304bb09af1..aaf80fbd50 100644
7575
this.rightToolbar.appendSeparator();
7676
this.rightToolbar.appendToolbarItem(new UI.Toolbar.ToolbarSettingToggle(
7777
--
78-
2.39.2 (Apple Git-143)
78+
2.41.0
7979

packages/wrangler-devtools/patches/0007-Remove-unsupported-profiler-UI.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 7312af32a23a62acc2f5661187ef90b01381c0de Mon Sep 17 00:00:00 2001
1+
From 300d56bf34269b93eb011a0a25bbd160f4d3e122 Mon Sep 17 00:00:00 2001
22
From: bcoll <[email protected]>
33
Date: Mon, 16 Jan 2023 16:32:45 +0000
4-
Subject: [PATCH 07/15] Remove unsupported profiler UI
4+
Subject: [PATCH 07/16] Remove unsupported profiler UI
55

66
---
77
front_end/panels/profiler/HeapProfilerPanel.ts | 2 +-
@@ -35,5 +35,5 @@ index c4680b48be..c2fe5b775f 100644
3535
this.profileViewToolbar = new UI.Toolbar.Toolbar('', this.toolbarElement);
3636
this.profileViewToolbar.makeWrappable(true);
3737
--
38-
2.39.2 (Apple Git-143)
38+
2.41.0
3939

packages/wrangler-devtools/patches/0008-Show-an-overlay-on-the-memory-tab-in-Firefox.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 70e79d4a4e1821021d0df627a23d62ede6c558ba Mon Sep 17 00:00:00 2001
1+
From 67881d8f2c90958d2532a8b2d794548b7836ec66 Mon Sep 17 00:00:00 2001
22
From: Samuel Macleod <[email protected]>
33
Date: Thu, 19 Jan 2023 18:49:47 +0000
4-
Subject: [PATCH 08/15] Show an overlay on the memory tab in Firefox
4+
Subject: [PATCH 08/16] Show an overlay on the memory tab in Firefox
55

66
---
77
front_end/entrypoint_template.html | 18 ++++++++++++++++--
@@ -71,5 +71,5 @@ index 693621a273..9b330e7cf0 100644
7171
flex: auto;
7272
position: relative;
7373
--
74-
2.39.2 (Apple Git-143)
74+
2.41.0
7575

packages/wrangler-devtools/patches/0009-Support-theme-url-parameter-for-forcing-the-theme-fr.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 0edd0dbfe2704ef6bc527cbfa68dd35989d95cc5 Mon Sep 17 00:00:00 2001
1+
From 010c48b5ab6ae04da9c348e985a5f41397437fdc Mon Sep 17 00:00:00 2001
22
From: Samuel Macleod <[email protected]>
33
Date: Fri, 20 Jan 2023 19:19:37 +0000
4-
Subject: [PATCH 09/15] Support theme= url parameter for forcing the theme from
4+
Subject: [PATCH 09/16] Support theme= url parameter for forcing the theme from
55
outside
66

77
---
@@ -41,5 +41,5 @@ index 05736bc0b8..530028d5b0 100644
4141
this.customSheets.clear();
4242
this.dispatchEvent(new ThemeChangeEvent());
4343
--
44-
2.39.2 (Apple Git-143)
44+
2.41.0
4545

packages/wrangler-devtools/patches/0010-Basic-support-for-text-colour-in-dark-mode-in-browse.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 9d34de7c9010659ece1be008ee852a21e06bff55 Mon Sep 17 00:00:00 2001
1+
From 7c24a16730403a6db93a01aeb0d07c4910d320f6 Mon Sep 17 00:00:00 2001
22
From: Samuel Macleod <[email protected]>
33
Date: Mon, 23 Jan 2023 15:12:38 +0000
4-
Subject: [PATCH 10/15] Basic support for text colour in dark mode in browsers
4+
Subject: [PATCH 10/16] Basic support for text colour in dark mode in browsers
55
that don't implement :host-context
66

77
---
@@ -46,5 +46,5 @@ index b451da60eb..8828dd8f07 100644
4646
<meta http-equiv="Content-Security-Policy"
4747
content="object-src 'none'; script-src 'sha256-yYUen+rS0+K2iGZTeGzgeav9eHB7hosjob+ahEOInok=' 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com">
4848
--
49-
2.39.2 (Apple Git-143)
49+
2.41.0
5050

packages/wrangler-devtools/patches/0011-Fallback-to-location-for-domain.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 0091abac4c9631649485198cc36b49ebd4fd40dd Mon Sep 17 00:00:00 2001
1+
From 035ac87786e0f52c9ce36680083a07f1806b24bb Mon Sep 17 00:00:00 2001
22
From: Samuel Macleod <[email protected]>
33
Date: Thu, 26 Jan 2023 15:27:04 +0000
4-
Subject: [PATCH 11/15] Fallback to location for domain
4+
Subject: [PATCH 11/16] Fallback to location for domain
55

66
---
77
front_end/panels/sources/NavigatorView.ts | 3 ++-
@@ -22,5 +22,5 @@ index c7a64ab432..ca32b5202e 100644
2222

2323
const parsedURL = new Common.ParsedURL.ParsedURL(projectOrigin);
2424
--
25-
2.39.2 (Apple Git-143)
25+
2.41.0
2626

packages/wrangler-devtools/patches/0012-Hide-unsupported-settings-UI.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From deeac26dadb8f2d7f5653c1994eed41f9e220af2 Mon Sep 17 00:00:00 2001
1+
From 3de10e06c66c60a9e2e34e4192571a0a8be30029 Mon Sep 17 00:00:00 2001
22
From: bcoll <[email protected]>
33
Date: Thu, 26 Jan 2023 15:30:34 +0000
4-
Subject: [PATCH 12/15] Hide unsupported settings UI
4+
Subject: [PATCH 12/16] Hide unsupported settings UI
55

66
- Show CORS errors in console setting
77
- Show XHR requests in console setting
@@ -62,5 +62,5 @@ index df0806e90d..0b20193865 100644
6262
+ display: none;
6363
+}
6464
--
65-
2.39.2 (Apple Git-143)
65+
2.41.0
6666

packages/wrangler-devtools/patches/0013-DEVX-380-Hide-debugger-sidebar-and-disable-breakpoin.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From cde74d1233f0e89563cfe4d458af197f21c22f18 Mon Sep 17 00:00:00 2001
1+
From f2618d9d26296daddb304e5bf8295775882ccbc5 Mon Sep 17 00:00:00 2001
22
From: bcoll <[email protected]>
33
Date: Wed, 15 Feb 2023 15:07:45 +0000
4-
Subject: [PATCH 13/15] DEVX-380 Hide debugger sidebar and disable breakpoints
4+
Subject: [PATCH 13/16] DEVX-380 Hide debugger sidebar and disable breakpoints
55

66
- Hides debugger sidebar
77
- Removes toggle debugger sidebar command
@@ -87,5 +87,5 @@ index c5e95ab535..9c53bca1b3 100644
8787
settingName: 'navigatorGroupByFolder',
8888
settingType: Common.Settings.SettingType.BOOLEAN,
8989
--
90-
2.39.2 (Apple Git-143)
90+
2.41.0
9191

packages/wrangler-devtools/patches/0014-Add-ping-to-improve-connection-stability.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 37cafef0a7f76f3c623e1c0016244b07f4dfc5d9 Mon Sep 17 00:00:00 2001
1+
From e17ef45cf30b880519d9be96402f784beb363c4e Mon Sep 17 00:00:00 2001
22
From: Samuel Macleod <[email protected]>
33
Date: Thu, 4 May 2023 03:21:58 +0100
4-
Subject: [PATCH 14/15] Add ping to improve connection stability
4+
Subject: [PATCH 14/16] Add ping to improve connection stability
55

66
---
77
front_end/core/protocol_client/InspectorBackend.ts | 9 +++++++++
@@ -40,5 +40,5 @@ index bc7ccf9c08..7d033a7b26 100644
4040

4141
registerSession(target: TargetBase, sessionId: string, proxyConnection?: Connection|null): void {
4242
--
43-
2.39.2 (Apple Git-143)
43+
2.41.0
4444

packages/wrangler-devtools/patches/0015-Support-sourcemaps.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 85fcb93878fac45074cc24d4e215ede8b9082339 Mon Sep 17 00:00:00 2001
1+
From cb79cae04886e81f8be78d4f90fad920b1e81f7c Mon Sep 17 00:00:00 2001
22
From: Samuel Macleod <[email protected]>
33
Date: Thu, 4 May 2023 03:22:33 +0100
4-
Subject: [PATCH 15/15] Support sourcemaps:
4+
Subject: [PATCH 15/16] Support sourcemaps:
55

66
* Recognise `wrangler://` URLs as "special", and always load them with Network.loadNetworkResource
77

@@ -56,5 +56,5 @@ index 87ad8ea645..047313c89c 100644
5656

5757
Root.Runtime.experiments.setNonConfigurableExperiments([
5858
--
59-
2.39.2 (Apple Git-143)
59+
2.41.0
6060

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
From 238f57c76bd8dc90069bb8004f832688ee1224db Mon Sep 17 00:00:00 2001
2+
From: Workers DevProd <[email protected]>
3+
Date: Thu, 17 Aug 2023 13:31:48 -0500
4+
Subject: [PATCH 16/16] Disable debugger when query parameter `debugger` is
5+
false Enable debugger by default
6+
7+
---
8+
front_end/panels/sources/DebuggerPlugin.ts | 8 +++++++
9+
front_end/panels/sources/SourcesPanel.ts | 14 +++++++++++-
10+
front_end/panels/sources/sources-meta.ts | 26 ++++++++++++++++++++++
11+
3 files changed, 47 insertions(+), 1 deletion(-)
12+
13+
diff --git a/front_end/panels/sources/DebuggerPlugin.ts b/front_end/panels/sources/DebuggerPlugin.ts
14+
index 6871a61d55..50b38ca92c 100644
15+
--- a/front_end/panels/sources/DebuggerPlugin.ts
16+
+++ b/front_end/panels/sources/DebuggerPlugin.ts
17+
@@ -228,6 +228,14 @@ export class DebuggerPlugin extends Plugin {
18+
this.scriptsPanel = SourcesPanel.instance();
19+
this.breakpointManager = Bindings.BreakpointManager.BreakpointManager.instance();
20+
21+
+ const debuggerQueryParam = Root.Runtime.Runtime.queryParam('debugger');
22+
+ if (debuggerQueryParam !== 'false') {
23+
+ this.breakpointManager.addEventListener(
24+
+ Bindings.BreakpointManager.Events.BreakpointAdded, this.breakpointChange, this);
25+
+ this.breakpointManager.addEventListener(
26+
+ Bindings.BreakpointManager.Events.BreakpointRemoved, this.breakpointChange, this);
27+
+ }
28+
+
29+
this.uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyChanged, this.workingCopyChanged, this);
30+
this.uiSourceCode.addEventListener(
31+
Workspace.UISourceCode.Events.WorkingCopyCommitted, this.workingCopyCommitted, this);
32+
diff --git a/front_end/panels/sources/SourcesPanel.ts b/front_end/panels/sources/SourcesPanel.ts
33+
index 1e094864ea..ac30f5d54c 100644
34+
--- a/front_end/panels/sources/SourcesPanel.ts
35+
+++ b/front_end/panels/sources/SourcesPanel.ts
36+
@@ -248,7 +248,11 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
37+
new UI.SplitWidget.SplitWidget(true, true, 'sourcesPanelSplitViewState', initialDebugSidebarWidth);
38+
this.splitWidget.enableShowModeSaving();
39+
this.splitWidget.show(this.element);
40+
- this.splitWidget.hideSidebar(false);
41+
+
42+
+ const debuggerQueryParam = Root.Runtime.Runtime.queryParam('debugger');
43+
+ if (debuggerQueryParam === 'false') {
44+
+ this.splitWidget.hideSidebar(false);
45+
+ }
46+
47+
// Create scripts navigator
48+
const initialNavigatorWidth = 225;
49+
@@ -355,6 +359,14 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
50+
panel.splitWidget.installResizer(panel.sourcesViewInternal.toolbarContainerElement());
51+
}
52+
if (!isInWrapper) {
53+
+ const debuggerQueryParam = Root.Runtime.Runtime.queryParam('debugger');
54+
+ if (debuggerQueryParam !== 'false') {
55+
+ if (panel.splitWidget.isVertical()) {
56+
+ panel.sourcesViewInternal.rightToolbar().appendToolbarItem(panel.toggleDebuggerSidebarButton);
57+
+ } else {
58+
+ panel.sourcesViewInternal.bottomToolbar().appendToolbarItem(panel.toggleDebuggerSidebarButton);
59+
+ }
60+
+ }
61+
panel.sourcesViewInternal.leftToolbar().appendToolbarItem(panel.toggleNavigatorSidebarButton);
62+
}
63+
}
64+
diff --git a/front_end/panels/sources/sources-meta.ts b/front_end/panels/sources/sources-meta.ts
65+
index 9c53bca1b3..036c33ea16 100644
66+
--- a/front_end/panels/sources/sources-meta.ts
67+
+++ b/front_end/panels/sources/sources-meta.ts
68+
@@ -586,6 +586,32 @@ UI.ActionRegistration.registerActionExtension({
69+
],
70+
});
71+
72+
+const debuggerQueryParam = Root.Runtime.Runtime.queryParam('debugger');
73+
+if (debuggerQueryParam !== 'false') {
74+
+ UI.ActionRegistration.registerActionExtension({
75+
+ actionId: 'sources.toggle-debugger-sidebar',
76+
+ category: UI.ActionRegistration.ActionCategory.SOURCES,
77+
+ title: i18nLazyString(UIStrings.toggleDebuggerSidebar),
78+
+ async loadActionDelegate() {
79+
+ const Sources = await loadSourcesModule();
80+
+ return Sources.SourcesPanel.ActionDelegate.instance();
81+
+ },
82+
+ contextTypes() {
83+
+ return maybeRetrieveContextTypes(Sources => [Sources.SourcesView.SourcesView]);
84+
+ },
85+
+ bindings: [
86+
+ {
87+
+ platform: UI.ActionRegistration.Platforms.WindowsLinux,
88+
+ shortcut: 'Ctrl+Shift+h',
89+
+ },
90+
+ {
91+
+ platform: UI.ActionRegistration.Platforms.Mac,
92+
+ shortcut: 'Meta+Shift+h',
93+
+ },
94+
+ ],
95+
+ });
96+
+}
97+
+
98+
UI.ActionRegistration.registerActionExtension({
99+
category: UI.ActionRegistration.ActionCategory.DEBUGGER,
100+
actionId: 'debugger.step-over',
101+
--
102+
2.41.0
103+

0 commit comments

Comments
 (0)