Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulation.setEmulatedMedia not working? #366

Open
gerjomarty opened this issue Jun 27, 2023 · 0 comments
Open

Emulation.setEmulatedMedia not working? #366

gerjomarty opened this issue Jun 27, 2023 · 0 comments

Comments

@gerjomarty
Copy link

Hello!

I'm trying to use the Emulation.setEmulatedMedia query to set the media query to print, but I get the error:

'Emulation.setEmulatedMedia' wasn't found (Ferrum::BrowserError)

Here is a single file reproduction of the problem:

require "bundler/inline"

gemfile do
  source "https://rubygems.org"
  gem "ferrum"
end

browser = Ferrum::Browser.new

browser.command("Emulation.setEmulatedMedia", media: "print")
browser.go_to("https://lachy.id.au/dev/css/tests/media/print/html401-print.html")
% ruby test.rb
/Users/me/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/ferrum-0.13/lib/ferrum/browser/client.rb:97:in `raise_browser_error': 'Emulation.setEmulatedMedia' wasn't found (Ferrum::BrowserError)
	from /Users/me/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/ferrum-0.13/lib/ferrum/browser/client.rb:49:in `command'
	from /Users/me/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/ferrum-0.13/lib/ferrum/browser.rb:209:in `command'
	from test.rb:10:in `<main>'

I'm not entirely sure where the issue lies here, apologies if the root cause is actually somewhere down the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant