Options
styles
CSS added to the page right before the capture.
- Type
- string
- Default
- None
- Group
- Custom code
On this page
OverviewLink to this section
CSS added to the page right before the capture, after your script. Use it to hide elements, swap fonts, pin a sticky header in place or force a theme.
Sites often style their own elements strongly, so add !important to rules that must win.
ExampleLink to this section
The same request with the SDK, with cURL and as the raw JSON body.
screenshot.ts
import { Url2Image } from '@url2image/sdk'
const { success, data, message } = await Url2Image({
url: 'https://example.com',
token: process.env.URL2IMAGE_TOKEN,
options: {
styles: 'header { position: static !important; } .chat-widget { display: none !important; }'
}
})Good to knowLink to this section
Related optionsLink to this section
scriptJavaScript added to the page right before the capture.bypassCSPIgnore the page Content Security Policy, which some custom scripts and styles need.themeModeThe color scheme the page sees, for sites with a dark mode.
Every option, grouped, is in the options overview.
Something unclear or missing on this page?
Tell us