Commit 6c03d80
Decouple context menu from debug flag on all backends
Every backend (GTK, EdgeChromium, Cocoa) tied the entire native
right-click context menu to webview.start()'s debug flag, not just the
devtools "Inspect Element" entry. Apps running with debug=False (the
normal production case) lost basic copy/paste and Back/Forward/Reload
along with it -- found live driving a real WebKitGTK window under Xvfb:
right-clicking a loaded page produced nothing with debug=False, no
matter what.
Adds settings['ENABLE_CONTEXT_MENU'] (default None, preserving the old
debug-tied behavior) so an app can force the context menu on/off
independently of debug. Devtools exposure itself
(enable_developer_extras / AreDevToolsEnabled / developerExtrasEnabled)
stays tied to debug on all three backends, unchanged -- this only
separates "show a normal context menu" from "expose devtools", which
were never actually the same decision for an end user.
Verified live: with ENABLE_CONTEXT_MENU=True and debug=False, right-
click on GTK now shows the normal Back/Forward/Stop/Reload menu with no
Inspect Element entry; the same window with the setting left at its
default shows no menu at all, reproducing the original bug.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent f12c7e6 commit 6c03d80
4 files changed
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
142 | 151 | | |
143 | 152 | | |
144 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
510 | 513 | | |
511 | 514 | | |
512 | 515 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
289 | 292 | | |
290 | 293 | | |
291 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
| |||
0 commit comments