New issue
Advanced search Search tips

Issue 834138 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Cannot use new dev-tool protocol 1.3 from chrome extension

Reported by zhenjun....@gmail.com, Apr 18 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36

Steps to reproduce the problem:
1. Try to attach 1.3 in background.js
2. When starts Chrome, on popup shows: Requested protocol version is not supported: 1.3.

What is the expected behavior?
I hope to use new domains from protocol 1.3, it's said the new protocol has been supported from Chrome 64. I'm using chrome 65。
https://chromedevtools.github.io/devtools-protocol/1-3

What went wrong?
One popup shows 1.3 is not supported

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 65.0.3325.181  Channel: n/a
OS Version: 10.0
Flash Version:
 
Labels: Needs-Triage-M65
Components: Platform>DevTools
Owner: dgozman@chromium.org
Status: Assigned (was: Unconfirmed)
Dmitry, can you please take a look? 
Status: Fixed (was: Assigned)
This was fixed in M66, I believe. Sorry for inconvenience! You can pass 1.2 meanwhile, and things should mostly work.
Thanks, I updated Chrome to 66, the popup message doesn't show now, either with 1.2 or 1.3.

But when I call Page.getFrameTree and Page.captureScreenshot, they both return 'undefined', here are my code:

chrome.debugger.sendCommand({tabId: tab_id}, 'Page.enable');
var frameTree = chrome.debugger.sendCommand({tabId: tab_id}, 'Page.getFrameTree');
console.log('frameTree: ', frameTree);
var screenShot = chrome.debugger.sendCommand({tabId: tab_id}, 'Page.captureScreenshot');
console.log('screenShot: ', screenShot);

Any suggestion on it?

You have to provide a callback to get result value. Please refer to https://developer.chrome.com/extensions/debugger for documentation.
@dgozman, I can get frameTree from callback API now, for each frame, I can see properties, like id, url, parentId, loaderId, etc, can I use them to get document of each frame? then search elements?

I'm working on a chrome extension, trying to get elements from web page, with pure javascript, I found window.frames cannot include dynamic-loaded frame.

With getFrameTree interface of dev-tool, I can get the basic info of dynamic-loaded frame now, the next step is get elements from this frame.
@dgozman, I can get document by DOM.getDocument interface now, and I can locate the element on the dynamic-frame by DOM.querySelector, the response is a nodeID, How can I get rect of this element(by a nodeID or a Node object from dev-tool)? like the function in javascript: getBoundingClientRect();

Sign in to add a comment