ferrum icon indicating copy to clipboard operation
ferrum copied to clipboard

Browser option --kiosk not working

Open Abvgdejg opened this issue 1 year ago • 2 comments

When creating a browser with the "kiosk" option, placing it on the Xvfb display and recording with ffmpeg, the browser UI elements remain.

Code:

require 'ferrum'

x = Ferrum::Browser::Xvfb.new(OpenStruct.new({ window_size: [1920, 1080] }))
x.start

b = Ferrum::Browser.new(headless: false, xvfb: true,
                        browser_options: {
                          'window-size': '1920,1080',
                          'display': ":#{x.display_id}",
                          'disable-infobars': nil,
                          'kiosk': nil
                        })
b.goto 'https://animejs.com/'

ffmpeg_command = "ffmpeg -y -video_size 1920x1080 -framerate 25 -f x11grab -i :#{x.display_id} -loglevel debug ./#{Time.now.to_i}.mp4"
pid = spawn(ffmpeg_command)
Process.detach(pid)

sleep 4

Process.kill('SIGINT', pid)
Process.kill('SIGINT', x.pid)
b.quit

https://github.com/rubycdp/ferrum/assets/108282610/ca80334c-ee77-47a1-bcab-d96e91da0e2b

Abvgdejg avatar May 30 '24 10:05 Abvgdejg

But you don't show any code you are running...

route avatar May 31 '24 11:05 route

But you don't show any code you are running...

Added code

Abvgdejg avatar May 31 '24 11:05 Abvgdejg