Skip to content

Commit f60fb43

Browse files
author
小野 直人
committed
Support "Force script execution" feature in Chrome
1 parent dd286af commit f60fb43

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

lib/debug/server_cdp.rb

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ def process
165165
@q_msg << req
166166
send_response req
167167
send_event 'Debugger.resumed'
168+
when 'Debugger.setSkipAllPauses'
169+
skip = req.dig('params', 'skip')
170+
if skip
171+
deactivate_bp
172+
else
173+
activate_bp bps
174+
end
175+
send_response req
168176

169177
# breakpoint
170178
when 'Debugger.getPossibleBreakpoints'
@@ -204,10 +212,9 @@ def process
204212
when 'Debugger.setBreakpointsActive'
205213
active = req.dig('params', 'active')
206214
if active
207-
bps.each{|b| SESSION.add_line_breakpoint(b.path, b.line.to_i)}
215+
activate_bp bps
208216
else
209-
@q_msg << 'del'
210-
@q_ans << 'y'
217+
deactivate_bp
211218
end
212219
send_response req
213220

@@ -225,6 +232,15 @@ def get_source_code path
225232
src
226233
end
227234

235+
def activate_bp bps
236+
bps.each{|b| SESSION.add_line_breakpoint(b.path, b.line.to_i)}
237+
end
238+
239+
def deactivate_bp
240+
@q_msg << 'del'
241+
@q_ans << 'y'
242+
end
243+
228244
## Called by the SESSION thread
229245

230246
def readline prompt

0 commit comments

Comments
 (0)