Skip to content

Commit

Permalink
new: Support for disabling JS during capture
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Oct 10, 2024
1 parent 91edb91 commit 70d4471
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pylacus/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class CaptureSettings(TypedDict, total=False):
timezone_id: str | None
locale: str | None
color_scheme: str | None
java_script_enabled: bool
viewport: dict[str, int] | None
referer: str | None
with_favicon: bool
Expand Down Expand Up @@ -145,6 +146,7 @@ def enqueue(self, *,
timezone_id: str | None=None,
locale: str | None=None,
color_scheme: str | None=None,
java_script_enabled: bool=True,
viewport: dict[str, int] | None=None,
referer: str | None=None,
with_favicon: bool=False,
Expand Down Expand Up @@ -173,6 +175,7 @@ def enqueue(self, *,
timezone_id: str | None=None,
locale: str | None=None,
color_scheme: str | None=None,
java_script_enabled: bool=True,
viewport: dict[str, int] | None=None,
referer: str | None=None,
with_favicon: bool=False,
Expand All @@ -188,7 +191,9 @@ def enqueue(self, *,
if settings:
to_enqueue = settings
else:
to_enqueue = {'depth': depth, 'rendered_hostname_only': rendered_hostname_only,
to_enqueue = {'depth': depth, 'java_script_enabled': java_script_enabled,
'with_favicon': with_favicon, 'allow_tracking': allow_tracking,
'rendered_hostname_only': rendered_hostname_only,
'force': force, 'recapture_interval': recapture_interval, 'priority': priority}
if url:
to_enqueue['url'] = url
Expand Down Expand Up @@ -223,10 +228,6 @@ def enqueue(self, *,
to_enqueue['viewport'] = viewport
if referer:
to_enqueue['referer'] = referer
if with_favicon:
to_enqueue['with_favicon'] = with_favicon
if allow_tracking:
to_enqueue['allow_tracking'] = allow_tracking
if uuid:
to_enqueue['uuid'] = uuid

Expand Down

0 comments on commit 70d4471

Please sign in to comment.