| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5fea51b commit a3e8829
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -130,6 +130,7 @@ class InspectorSession { | |||
| 130 | 130 | this._unprocessedNotifications = []; | |
| 131 | 131 | this._notificationCallback = null; | |
| 132 | 132 | this._scriptsIdsByUrl = new Map(); | |
| 133 | + this._pausedDetails = null; | ||
| 133 | 134 | ||
| 134 | 135 | let buffer = Buffer.alloc(0); | |
| 135 | 136 | socket.on('data', (data) => { | |
@@ -179,6 +180,10 @@ class InspectorSession { | |||
| 179 | 180 | this.mainScriptId = scriptId; | |
| 180 | 181 | } | |
| 181 | 182 | } | |
| 183 | + if (message.method === 'Debugger.paused') | ||
| 184 | + this._pausedDetails = message.params; | ||
| 185 | + if (message.method === 'Debugger.resumed') | ||
| 186 | + this._pausedDetails = null; | ||
| 182 | 187 | ||
| 183 | 188 | if (this._notificationCallback) { | |
| 184 | 189 | // In case callback needs to install another | |
@@ -267,6 +272,10 @@ class InspectorSession { | |||
| 267 | 272 | `break on ${url}:${line}`); | |
| 268 | 273 | } | |
| 269 | 274 | ||
| 275 | + pausedDetails() { | ||
| 276 | + return this._pausedDetails; | ||
| 277 | + } | ||
| 278 | + | ||
| 270 | 279 | _matchesConsoleOutputNotification(notification, type, values) { | |
| 271 | 280 | if (!Array.isArray(values)) | |
| 272 | 281 | values = [ values ]; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,7 +78,7 @@ async function testBreakpoint(session) { | |||
| 78 | 78 | ||
| 79 | 79 | let { result } = await session.send({ | |
| 80 | 80 | 'method': 'Debugger.evaluateOnCallFrame', 'params': { | |
| 81 | - 'callFrameId': '{"ordinal":0,"injectedScriptId":1}', | ||
| 81 | + 'callFrameId': session.pausedDetails().callFrames[0].callFrameId, | ||
| 82 | 82 | 'expression': 'k + t', | |
| 83 | 83 | 'objectGroup': 'console', | |
| 84 | 84 | 'includeCommandLineAPI': true, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,7 +116,7 @@ async function testBreakpoint(session) { | |||
| 116 | 116 | ||
| 117 | 117 | let { result } = await session.send({ | |
| 118 | 118 | 'method': 'Debugger.evaluateOnCallFrame', 'params': { | |
| 119 | - 'callFrameId': '{"ordinal":0,"injectedScriptId":1}', | ||
| 119 | + 'callFrameId': session.pausedDetails().callFrames[0].callFrameId, | ||
| 120 | 120 | 'expression': 'k + t', | |
| 121 | 121 | 'objectGroup': 'console', | |
| 122 | 122 | 'includeCommandLineAPI': true, | |
@@ -150,7 +150,7 @@ async function testI18NCharacters(session) { | |||
| 150 | 150 | const chars = 'טֶ字и'; | |
| 151 | 151 | session.send({ | |
| 152 | 152 | 'method': 'Debugger.evaluateOnCallFrame', 'params': { | |
| 153 | - 'callFrameId': '{"ordinal":0,"injectedScriptId":1}', | ||
| 153 | + 'callFrameId': session.pausedDetails().callFrames[0].callFrameId, | ||
| 154 | 154 | 'expression': `console.log("${chars}")`, | |
| 155 | 155 | 'objectGroup': 'console', | |
| 156 | 156 | 'includeCommandLineAPI': true, | |
@@ -276,7 +276,7 @@ async function testCommandLineAPI(session) { | |||
| 276 | 276 | result = await session.send( | |
| 277 | 277 | { | |
| 278 | 278 | 'method': 'Debugger.evaluateOnCallFrame', 'params': { | |
| 279 | - 'callFrameId': '{"ordinal":0,"injectedScriptId":1}', | ||
| 279 | + 'callFrameId': session.pausedDetails().callFrames[0].callFrameId, | ||
| 280 | 280 | 'expression': `( | |
| 281 | 281 | require(${printBModuleStr}), | |
| 282 | 282 | require.cache[${printBModuleStr}].parent.id | |
| Back | FazBrowse Home | New Git URL |
0 commit comments