Target.targetCreated((params) => {
console.log("Target Created");
});
but that does not do anything when the popup opens :(
What I would like to do is, when the popup opens to be able to interact with it the same way as I do with the page i loaded with
Page.navigate({url: url});
that is see all the loaded resources, see the actual page url and be able to interact with it.
Any help woudl be greatly appriciated :-)
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/07750c89-89e1-46af-96c7-43ef2a18d503%40chromium.org.
Target.targetCreated((params) => {
console.log("Target Created");
if(params.targetInfo.type != "other")
return;
console.log("Target Attaching");
Target.attachedToTarget({targetInfo: params.targetInfo, waitingForDebugger: false})
});
attache to target fails:
TypeError: "listener" argument must be a function
at _addListener (events.js:216:11)
at Chrome.addListener (events.js:276:10)
at Object.handler [as attachedToTarget] (\node_modules\chrome-remote-interface\lib\api.js:40:16)
at Chrome.inspector.inspectPage.CDP.then.Target.targetCreated (\inspector.ts:169:24)
at emitOne (events.js:96:13)
at Chrome.emit (events.js:188:7)
at Chrome.handleMessage (\node_modules\chrome-remote-interface\lib\chrome.js:237:16)
at WebSocket.<anonymous> (\node_modules\chrome-remote-interface\lib\chrome.js:200:27)
at emitTwo (events.js:106:13)
at WebSocket.emit (events.js:191:7)
ah...
Target.attachedToTarget
should be
Target.attachToTarget
now it seams to work
thanks
CDP(chromeOptions).then((client) => {
// extract domains
const {Network, Page, Target} = client;
Target.setDiscoverTargets({discover: true});
Target.targetCreated((params) => {
console.log("Target Created");
if(params.targetInfo.type != "other")
return;
console.log("Target Attaching");
Target.attachToTarget({targetId: params.targetInfo.targetId}).then((test)=>{
debugger;
})
});
Target.targetDestroyed((params) => {
console.log("Target Destroyed");
});
Network.responseReceived
do I need a new instance of the debugger to work?
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/c04a8fb0-5fe7-4baf-aec5-491ae063a5a8%40chromium.org.
I might be wrong but, once you do attachToTarget, try using `Page` (it will have the new target).
On Sun, May 21, 2017 at 10:32 AM, <xanato...@gmail.com> wrote:
CDP(chromeOptions).then((client) => {
// extract domains
const {Network, Page, Target} = client;
Target.setDiscoverTargets({discover: true});
Target.targetCreated((params) => {
console.log("Target Created");
if(params.targetInfo.type != "other")
return;
console.log("Target Attaching");
Target.attachToTarget({targetId: params.targetInfo.targetId}).then((test)=>{
debugger;
})
});
Target.targetDestroyed((params) => {
console.log("Target Destroyed");
});
now it says its attached, but i don't see any resources of the new windows being loaded inNetwork.responseReceived
do I need a new instance of the debugger to work?
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/121cec29-5f0c-45a9-81ea-67d74ac7a7e5%40chromium.org.