document chrome configs

This commit is contained in:
Nick Sweeting
2025-12-30 12:42:50 -08:00
parent 93a78ce595
commit 08366cfa46
2 changed files with 30 additions and 7 deletions

View File

@@ -100,6 +100,9 @@ def run_plugins(
is_tty = sys.stdout.isatty() is_tty = sys.stdout.isatty()
# Parse comma-separated plugins list once (reused in creation and filtering)
plugins_list = [p.strip() for p in plugins.split(',') if p.strip()] if plugins else []
# Collect all input records # Collect all input records
records = list(read_args_or_stdin(args)) records = list(read_args_or_stdin(args))
@@ -147,10 +150,7 @@ def run_plugins(
continue continue
# Create pending ArchiveResults if needed # Create pending ArchiveResults if needed
if plugins: if plugins_list:
# Parse comma-separated plugins list
plugins_list = [p.strip() for p in plugins.split(',') if p.strip()]
# Only create for specific plugins # Only create for specific plugins
for plugin_name in plugins_list: for plugin_name in plugins_list:
result, created = ArchiveResult.objects.get_or_create( result, created = ArchiveResult.objects.get_or_create(
@@ -195,9 +195,7 @@ def run_plugins(
try: try:
snapshot = Snapshot.objects.get(id=snapshot_id) snapshot = Snapshot.objects.get(id=snapshot_id)
results = snapshot.archiveresult_set.all() results = snapshot.archiveresult_set.all()
if plugins: if plugins_list:
# Parse comma-separated plugins list
plugins_list = [p.strip() for p in plugins.split(',') if p.strip()]
results = results.filter(plugin__in=plugins_list) results = results.filter(plugin__in=plugins_list)
for result in results: for result in results:

View File

@@ -63,6 +63,31 @@
"default": [], "default": [],
"x-aliases": ["CHROME_EXTRA_ARGS"], "x-aliases": ["CHROME_EXTRA_ARGS"],
"description": "Extra arguments to append to Chrome command" "description": "Extra arguments to append to Chrome command"
},
"CHROME_PAGELOAD_TIMEOUT": {
"type": "integer",
"default": 60,
"minimum": 5,
"x-fallback": "CHROME_TIMEOUT",
"description": "Timeout for page navigation/load in seconds"
},
"CHROME_WAIT_FOR": {
"type": "string",
"default": "networkidle2",
"enum": ["domcontentloaded", "load", "networkidle0", "networkidle2"],
"description": "Page load completion condition (domcontentloaded, load, networkidle0, networkidle2)"
},
"CHROME_DELAY_AFTER_LOAD": {
"type": "number",
"default": 0,
"minimum": 0,
"description": "Extra delay in seconds after page load completes before archiving (useful for JS-heavy SPAs)"
},
"CHROME_CHECK_SSL_VALIDITY": {
"type": "boolean",
"default": true,
"x-fallback": "CHECK_SSL_VALIDITY",
"description": "Whether to verify SSL certificates (disable for self-signed certs)"
} }
} }
} }