You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the event "Debugger.scriptParsed" is correctly handled, getScriptSource() always returns "undefined" value.
I guess I was invoking the method (getScriptSource()) in a wrong way as inspector.js of blink is calling the getScriptSource() via DebuggerAgent, which seems to be the wrapper of Debugger interface.
var spawn=require('child_process').spawn;
var Chrome = require('chrome-remote-interface');
var initWaitTime = 2000;
var ChromePath = "/usr/bin/chromium-browser";
function runChrome(extensionDir) {
var args = [];
args.push("--remote-debugging-port=9222");
args.push("--user-data-dir=remote-profile");
args.push("-no-default-browser-check");
spawn(ChromePath, args)
};
function runChromeDebugger(urlToVisit) {
console.log("runChromeDebugger");
options = {};
Chrome(options, function (chrome) {
with (chrome) {
on('Debugger.scriptParsed', function (msg) {
console.log("==================================");
console.log(JSON.stringify(msg));
console.log("scriptParsed scriptId: " + msg.scriptId); // scriptId is correctly returned
var ssrc = chrome.Debugger.getScriptSource({'scriptId':msg.scriptId});
console.log("scriptSource :" + ssrc); // bug? always undefined
});
Page.enable();
Debugger.enable();
Page.navigate({'url': urlToVisit});
console.log("[*] opened [" + urlToVisit + "]");
}
}).on('error', function () {
console.error('Cannot connect to Chrome');
});
}
if (require.main == module) {
runChrome("/home/blee/project/chrome-extension-integrity/sample/buzzdoc");
var urlToVisit = "http://google.com"
setTimeout(function() {runChromeDebugger(urlToVisit)}, initWaitTime);
}
The text was updated successfully, but these errors were encountered:
While the event "Debugger.scriptParsed" is correctly handled, getScriptSource() always returns "undefined" value.
I guess I was invoking the method (getScriptSource()) in a wrong way as inspector.js of blink is calling the getScriptSource() via DebuggerAgent, which seems to be the wrapper of Debugger interface.
var spawn=require('child_process').spawn;
var Chrome = require('chrome-remote-interface');
var initWaitTime = 2000;
var ChromePath = "/usr/bin/chromium-browser";
function runChrome(extensionDir) {
var args = [];
args.push("--remote-debugging-port=9222");
args.push("--user-data-dir=remote-profile");
args.push("-no-default-browser-check");
spawn(ChromePath, args)
};
function runChromeDebugger(urlToVisit) {
console.log("runChromeDebugger");
options = {};
Chrome(options, function (chrome) {
with (chrome) {
on('Debugger.scriptParsed', function (msg) {
console.log("==================================");
console.log(JSON.stringify(msg));
console.log("scriptParsed scriptId: " + msg.scriptId); // scriptId is correctly returned
var ssrc = chrome.Debugger.getScriptSource({'scriptId':msg.scriptId});
console.log("scriptSource :" + ssrc); // bug? always undefined
});
Page.enable();
Debugger.enable();
Page.navigate({'url': urlToVisit});
console.log("[*] opened [" + urlToVisit + "]");
}
}).on('error', function () {
console.error('Cannot connect to Chrome');
});
}
if (require.main == module) {
runChrome("/home/blee/project/chrome-extension-integrity/sample/buzzdoc");
var urlToVisit = "http://google.com"
setTimeout(function() {runChromeDebugger(urlToVisit)}, initWaitTime);
}
The text was updated successfully, but these errors were encountered: