cuprite icon indicating copy to clipboard operation
cuprite copied to clipboard

Add support for emulating devices for hover and pointer css media queries

Open simonjnesta opened this issue 1 year ago • 1 comments

The pointer, any-pointer, hover and any-hover media queries allow you to style a page based on the available input devices. Currently there is no way I can see to change how cuprite/ferrum responds to these queries.

E.g. I have a site where the navigation is different based on whether you have a mouse or not. Currently, only the touch version of the site can be tested because @media (any-hover: hover) will never work in a cuprite-driven browser.

simonjnesta avatar Nov 21 '24 09:11 simonjnesta

If you can live with always having the same setting, you can set the browser option blink-settings for this.

For example:

  Capybara::Cuprite::Driver.new(app, {
                                  browser_options: {
                                    'blink-settings': 'primaryPointerType=4'
                                  }
                                })

phylor avatar Dec 04 '24 10:12 phylor