Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions lib/gotenberg/chromium/properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ def wait_for_expression expression

self
end


# Waits for the network to be idle before converting an HTML document to PDF.
# https://gotenberg.dev/docs/routes#performance-mode-chromium
def wait_for_network_idle
properties['skipNetworkIdleEvent'] = false # default is true

self
end

# DEPRECATED in Gotenberg 8. Overrides the default "User-Agent" header.
def user_agent user_agent
properties['userAgent'] = user_agent
Expand All @@ -108,7 +116,7 @@ def fail_on_console_exceptions

self
end

# Forces Chromium to emulate the media type "print" or "screen".
def emulate_media_type type
properties['emulatedMediaType'] = type
Expand Down Expand Up @@ -140,10 +148,10 @@ def url url, extra_link_tags = [], extra_script_tags = []
end

private

def properties
@properties ||= {}
end
end
end
end
end