improve plugin tests and config

This commit is contained in:
Nick Sweeting
2025-12-29 00:45:23 -08:00
parent f0aa19fa7d
commit 1e4d3ffd11
126 changed files with 2286 additions and 1717 deletions

View File

@@ -0,0 +1,21 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"required_plugins": ["chrome"],
"properties": {
"STATICFILE_ENABLED": {
"type": "boolean",
"default": true,
"x-aliases": ["SAVE_STATICFILE", "USE_STATICFILE"],
"description": "Enable static file detection"
},
"STATICFILE_TIMEOUT": {
"type": "integer",
"default": 30,
"minimum": 5,
"x-fallback": "TIMEOUT",
"description": "Timeout for static file detection in seconds"
}
}
}

View File

@@ -382,9 +382,9 @@ async function main() {
originalUrl = url;
if (!getEnvBool('SAVE_STATICFILE', true)) {
console.error('Skipping (SAVE_STATICFILE=False)');
console.log(JSON.stringify({type: 'ArchiveResult', status: 'skipped', output_str: 'SAVE_STATICFILE=False'}));
if (!getEnvBool('STATICFILE_ENABLED', true)) {
console.error('Skipping (STATICFILE_ENABLED=False)');
console.log(JSON.stringify({type: 'ArchiveResult', status: 'skipped', output_str: 'STATICFILE_ENABLED=False'}));
process.exit(0);
}

View File

@@ -0,0 +1 @@
📎

View File

@@ -0,0 +1,24 @@
<!-- Staticfile thumbnail - preview of the static file -->
<div class="extractor-thumbnail staticfile-thumbnail" style="width: 100%; height: 100px; overflow: hidden; background: #f5f5f5;">
{% if output_path %}
{% if output_path|lower|slice:"-4:" == ".pdf" or "application/pdf" in output_path %}
<embed src="{{ output_path }}#toolbar=0&navpanes=0&scrollbar=0&page=1&view=FitH"
type="application/pdf"
style="width: 100%; height: 200px; margin-top: -20px; pointer-events: none;">
{% elif output_path|lower|slice:"-4:" in ".jpg.png.gif.svg.bmp.webp.avif.heic" or output_path|lower|slice:"-5:" == ".jpeg" %}
<img src="{{ output_path }}"
style="width: 100%; height: 100%; object-fit: cover;"
loading="lazy">
{% elif output_path|lower|slice:"-4:" in ".mp4.webm.mov.avi.mkv" or output_path|lower|slice:"-5:" == ".mpeg" %}
<video src="{{ output_path }}"
style="width: 100%; height: 100%; object-fit: cover;"
preload="metadata"
muted></video>
{% else %}
<iframe src="{{ output_path }}"
style="width: 100%; height: 100%; border: none; pointer-events: none;"
loading="lazy"
sandbox="allow-same-origin"></iframe>
{% endif %}
{% endif %}
</div>