Comments (2)
This is what I was looking for:
library(chromote)
b <- ChromoteSession$new()
b$Emulation$setDeviceMetricsOverride(width = 1920, height = 1080, deviceScaleFactor = 1, mobile = FALSE)
b$Page$navigate("https://github.com/rstudio/chromote")
Sys.sleep(3)
b$screenshot("snap.png")
This snapshot comes out at width 1905 and may be the closest case to rstudio/shinytest2#171, and it is the case which is actually fixed by b$Emulation$setScrollbarsHidden(TRUE)
, somewhat regardless of where one puts it.
library(chromote)
b <- ChromoteSession$new()
# b$Emulation$setScrollbarsHidden(TRUE) # works
b$Emulation$setDeviceMetricsOverride(width = 1920, height = 1080, deviceScaleFactor = 1, mobile = FALSE)
# b$Emulation$setScrollbarsHidden(TRUE) # works
b$Page$navigate("https://github.com/rstudio/chromote")
b$Emulation$setScrollbarsHidden(TRUE) # works
Sys.sleep(3)
b$screenshot("snap.png")
This snapshot is 1920 pixels wide, as expected. Interestingly, screenshot()
does call setScrollbarsHidden
already, but that call seems to be ineffective for some reason:
Line 52 in 865e24e
from chromote.
Closing, since it seems like you figured out a solution.
from chromote.
Related Issues (20)
- Use option to set default timeout
- Can´t start Chromium in Docker HOT 1
- loadEventFired not triggering on client-side page loading or internal loading
- Problem with chromote package
- How to capture the time effect when a section of the web page is loaded (not entire page)?. HOT 2
- paste into $view fields
- ERR_HTTP2_PROTOCOL_ERROR when trying to navigate to a website HOT 2
- Is it expected that a screenshot from an URL with fragment capture the page from the top? HOT 2
- Are left and top of cliprect swapped? HOT 3
- ChromeRemote unable to call is_alive() HOT 3
- Problem with Chrome v128 HOT 41
- Headless Chrome updates HOT 3
- Release chromote 0.3.0
- get rid of "sleep()" anti-pattern? HOT 3
- Create a `ChromoteSession$nagivate()` method? HOT 6
- Alternative to running `--no-sandbox` on Posit Workbench
- Document steps needed to use chromote in Posit Workbench HOT 1
- Problems running chromote in Google Cloud Run
- Add chrome path validity check
- Add `chromote::chromote_info()` similar to `devtools::session_info()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chromote.