1
This commit is contained in:
parent
87bd27537a
commit
daf4976964
@ -1,6 +1,15 @@
|
|||||||
|
|
||||||
def _b_cmd(browser, tab, scriptmgr, params):
|
def _b_cmd(browser, tab, scriptmgr, params):
|
||||||
pass
|
filename = params[0].split(':')[0]
|
||||||
|
line = int(params[0].split(':')[1])
|
||||||
|
url = scriptmgr.getUrl(filename)
|
||||||
|
print(params, url)
|
||||||
|
tab.call_method("Debugger.setBreakpointByUrl",
|
||||||
|
lineNumber=line,
|
||||||
|
url=url,
|
||||||
|
columnNumber=0,
|
||||||
|
condition=''
|
||||||
|
)
|
||||||
|
|
||||||
def _p_cmd(browser, tab, scriptmgr, params):
|
def _p_cmd(browser, tab, scriptmgr, params):
|
||||||
pass
|
pass
|
||||||
@ -13,6 +22,7 @@ def _processCdbCmd(cmd_str, browser, tab, scriptmgr):
|
|||||||
'b': _b_cmd,
|
'b': _b_cmd,
|
||||||
'p': None,
|
'p': None,
|
||||||
}
|
}
|
||||||
|
print(cmdlist)
|
||||||
if cmdlist[0] in cmd_hash:
|
if cmdlist[0] in cmd_hash:
|
||||||
cmd_hash[cmdlist[0]](browser, tab, scriptmgr, cmdlist[1:])
|
cmd_hash[cmdlist[0]](browser, tab, scriptmgr, cmdlist[1:])
|
||||||
else:
|
else:
|
||||||
@ -25,7 +35,7 @@ def processCmd(browser, tab, scriptmgr):
|
|||||||
if cmdline[0] == '!':
|
if cmdline[0] == '!':
|
||||||
msg = eval(cmdline[1:])
|
msg = eval(cmdline[1:])
|
||||||
else:
|
else:
|
||||||
_processCdbCmd(cmdline[1:], browser, tab, scriptmgr)
|
_processCdbCmd(cmdline, browser, tab, scriptmgr)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
@ -8,3 +8,9 @@ class ScriptMgr:
|
|||||||
|
|
||||||
def debuggerOnScriptParsed(self, **kwargs):
|
def debuggerOnScriptParsed(self, **kwargs):
|
||||||
self.scripts.append(kwargs)
|
self.scripts.append(kwargs)
|
||||||
|
|
||||||
|
def getUrl(self, filename):
|
||||||
|
for script in self.scripts:
|
||||||
|
if filename in script['url']:
|
||||||
|
return script['url']
|
||||||
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user