--hide-scrollbars doesn't work anymore after Target.createTarget
Reported by
potoms....@gmail.com,
Jan 9 2017
|
||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36
Steps to reproduce the problem:
Chrome Version: 57.0.2970.0
OS: Linux
1. run chrome with "--headless --no-sandbox --disable-gpu --remote-debugging-port=9222 --hide-scrollbars"
2. run following node script:
var chrome = require('chrome-remote-interface');
function createTarget (devtools, options) {
return devtools.Target.createTarget(options)
.then(({ targetId }) => {
return chrome.List()
.then(list => {
var url = list.find(target => target.id === targetId).webSocketDebuggerUrl;
return chrome({ tab: url });
});
});
}
function getScreenshot (devtools, url) {
return devtools.Page.navigate({ url })
.then(() => new Promise(resolve => setTimeout(resolve, 3000)))
.then(() => devtools.Page.captureScreenshot())
.then(({ data }) => data);
}
function getScreenshotInNewTarget (devtools, url) {
return createTarget(devtools, { url: 'about:blank' })
.then(target => getScreenshot(target, url));
}
var url = 'https://www.google.com';
chrome({ port: 9222 })
.then(devtools => {
return getScreenshot(devtools, url)
.then(initial => {
return getScreenshotInNewTarget(devtools, url)
.then(inNewTarget => ({initial, inNewTarget}));
});
})
.then(({initial, inNewTarget}) => console.log(`
<img src="data:image/png;base64,${initial}"/>
<img src="data:image/png;base64,${inNewTarget}"/>
`))
.catch(e => console.error(e));
3. inspect the produced images
What is the expected behavior?
Both screenshots don't have scrollbars
What went wrong?
the screenshot that was made in the new target has scrollbars
Did this work before? N/A
Chrome version: 57.0.2970.0 Channel: dev
OS Version:
Flash Version: Shockwave Flash 24.0 r0
,
Jan 13 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c3ead867afb360569076daac6ed5563405f395b4 commit c3ead867afb360569076daac6ed5563405f395b4 Author: eseckler <eseckler@chromium.org> Date: Fri Jan 13 12:21:27 2017 [headless] Add default browser context to HeadlessBrowser. This also modifies HeadlessDevToolsManagerDelegate to send error responses if required parameters are missing. BUG= 679343 , 546953 Review-Url: https://codereview.chromium.org/2626823003 Cr-Commit-Position: refs/heads/master@{#443538} [modify] https://crrev.com/c3ead867afb360569076daac6ed5563405f395b4/headless/app/headless_shell.cc [modify] https://crrev.com/c3ead867afb360569076daac6ed5563405f395b4/headless/lib/browser/headless_browser_impl.cc [modify] https://crrev.com/c3ead867afb360569076daac6ed5563405f395b4/headless/lib/browser/headless_browser_impl.h [modify] https://crrev.com/c3ead867afb360569076daac6ed5563405f395b4/headless/lib/browser/headless_devtools_manager_delegate.cc [modify] https://crrev.com/c3ead867afb360569076daac6ed5563405f395b4/headless/lib/browser/headless_devtools_manager_delegate.h [modify] https://crrev.com/c3ead867afb360569076daac6ed5563405f395b4/headless/public/headless_browser.h [modify] https://crrev.com/c3ead867afb360569076daac6ed5563405f395b4/headless/test/headless_browser_test.cc
,
Jan 13 2017
Patch above should address a). I intent to add the hide_scrollbars option to HeadlessBrowser::Options to address b). skyostil@/alexclarke@: While I'm at it, should we try to add protocol_handlers there, too, so that --determistic-fetch can affect all contexts? It's a little more complicated for those, since ProtocolHandlerMap cannot currently be copied, but is modified by HeadlessBrowserContext::Builder::Build().
,
Jan 13 2017
I'm not sure what we can do with protocol handlers because they're owned by the browser context and thus can only belong to exactly one. One option would be to install wrapper handlers that delegate back to the original ones, I'm not sure what the API for that would look like. In any case, it should be completely obvious to the user which context gets which protocol handlers to avoid introducing subtle security bugs.
,
Jan 24 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b6dc3caa93f5db4213f9e3790d469cfd841bb466 commit b6dc3caa93f5db4213f9e3790d469cfd841bb466 Author: eseckler <eseckler@chromium.org> Date: Tue Jan 24 13:23:07 2017 [headless] Make --hide-scrollbars affect all BrowserContexts. BUG= 679343 Review-Url: https://codereview.chromium.org/2642143002 Cr-Commit-Position: refs/heads/master@{#445712} [modify] https://crrev.com/b6dc3caa93f5db4213f9e3790d469cfd841bb466/headless/app/headless_shell.cc [modify] https://crrev.com/b6dc3caa93f5db4213f9e3790d469cfd841bb466/headless/lib/browser/headless_browser_context_options.cc [modify] https://crrev.com/b6dc3caa93f5db4213f9e3790d469cfd841bb466/headless/lib/browser/headless_browser_context_options.h [modify] https://crrev.com/b6dc3caa93f5db4213f9e3790d469cfd841bb466/headless/public/headless_browser.cc [modify] https://crrev.com/b6dc3caa93f5db4213f9e3790d469cfd841bb466/headless/public/headless_browser.h [modify] https://crrev.com/b6dc3caa93f5db4213f9e3790d469cfd841bb466/headless/public/headless_browser_context.h
,
Jan 24 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by eseckler@chromium.org
, Jan 9 2017Labels: Proj-Headless
Owner: eseckler@chromium.org
Status: Assigned (was: Unconfirmed)