Skip to content

Questions related to developer tools #282

@pccasto

Description

@pccasto

I just discovered the project this afternoon. Thank you - saves me from having to do a bunch of ugly hand crafted calls!

I've got a few interrelated questions - if these should be broken as separate issues, please let me know.

  1. I'm trying to launch the developer tools, and other functions without any success.
    browser.keyboard.type [:ctrl, :shift, 'I'] -- no developer tools
    browser.keyboard.type [:ctrl, 'u'] -- no source code tab launched

  2. When I manually launch the developer tools by interacting with the browser, and then:
    browser.screenshot path: 'page.png'
    -- screenshots the base page, but does not include the developer tools sidebar
    browser.screenshot path: 'page_full.png', full:true
    -- causes the browser window to paint to the entire screen, but no additional info (titlebar, or developer tools sidebar)
    [set longer timeout to get results, because of long full page redraw via X]

Some of this could be due to the environment, but before going down the path of moving code around, I wanted to check expectations.

  • Should keystroke combinations be passed to control the chromium instance, or do they always wind up with the page?
  • And as I type this out, I realize that the keystrokes are going via a websocket associated with the page... So is there a way of achieving what I was trying to accomplish? Looks like keyboard & type methods are associated with page objects.
  • Is there a way to screenshot a page to include an open developer sidebar window? Or even a way to capture the two portions as separate images?

My environment (perhaps a bit more than is relevant, but just in case):

  • Ruby 2.7.6 on MacOS with ferrum 0.11
  • Chromium Version 72.0.3626.53 (Developer Build) built on Debian buster/sid, running on Debian kali-rolling (64-bit)
  • The debug port of the chromium control browser running on Linux is accessed via SSH port forwarding
    browser = Ferrum::Browser.new(url: 'http://localhost:9223') => Linux chromium listening on 9222.
  • Chromium browser that is the target of the browser object activities is coming back to the Mac via X11.

Sure, I could have started with something easier, but what's the fun in that...
But it shows why your project is so intriguing!

I did try simplifying by running everything natively on the Mac, but with the same results.

  • No ability to send 'control keys' to browser
  • Screenshots do not include developer tools sidebar
    • (and full:true still only shows page & not titlebar - which might be as expected)

Thanks, and Best Regards,
Paul

[ Also - I'm looking through the docs here: https://chromedevtools.github.io/devtools-protocol/ because I realize that some of this functionality is really tied to the core, rather than what you are exposing via the Ruby interface. Just hoping you might have already explored these areas, and have some insights. ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions