From e8c8be94e6dcb63a3d473a8d48fba642bd40ec99 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 24 Mar 2026 14:44:15 +0100 Subject: [PATCH] tweaks --- .../templates/browser_profiles.html | 2 ++ changedetectionio/blueprint/ui/edit.py | 6 +++++- changedetectionio/model/__init__.py | 2 +- docs/api-spec.yaml | 16 +++++++--------- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/changedetectionio/blueprint/settings_browser_profile/templates/browser_profiles.html b/changedetectionio/blueprint/settings_browser_profile/templates/browser_profiles.html index 00e6da54..7cf8d96c 100644 --- a/changedetectionio/blueprint/settings_browser_profile/templates/browser_profiles.html +++ b/changedetectionio/blueprint/settings_browser_profile/templates/browser_profiles.html @@ -17,6 +17,7 @@ {{ _('Default') }} {{ _('Name') }} {{ _('Fetch method') }} + {{ _('Viewport') }} {{ _('Options') }} @@ -38,6 +39,7 @@ {% if profile.is_builtin %}{{ _('built-in') }}{% endif %} {{ profile.fetch_backend }} + {{ profile.get_fetcher_class_name()|fetcher_status_icons }} {{ profile.viewport_width }}×{{ profile.viewport_height }} {% if profile.block_images %}🚫🖼 {% endif %} diff --git a/changedetectionio/blueprint/ui/edit.py b/changedetectionio/blueprint/ui/edit.py index 6c8b159d..343b7086 100644 --- a/changedetectionio/blueprint/ui/edit.py +++ b/changedetectionio/blueprint/ui/edit.py @@ -67,6 +67,10 @@ def construct_blueprint(datastore: ChangeDetectionStore, update_q, queuedWatchMe default['proxy'] = '' # proxy_override set to the json/text list of the items + # browser_profile: None means "use system default" — map to 'system' so the radio pre-selects correctly + if not default.get('browser_profile'): + default['browser_profile'] = 'system' + # Does it use some custom form? does one exist? processor_name = datastore.data['watching'][uuid].get('processor', '') processor_classes = next((tpl for tpl in processors.find_processors() if tpl[1] == processor_name), None) @@ -224,7 +228,7 @@ def construct_blueprint(datastore: ChangeDetectionStore, update_q, queuedWatchMe # Recast it if need be to right data Watch handler watch_class = processors.get_custom_watch_obj_for_processor(form.data.get('processor')) - datastore.data['watching'][uuid] = watch_class(datastore_path=datastore.datastore_path, __datastore=datastore.data, default=datastore.data['watching'][uuid]) + datastore.data['watching'][uuid] = watch_class(datastore_path=datastore.datastore_path, __datastore=datastore, default=datastore.data['watching'][uuid]) # Save the watch immediately datastore.data['watching'][uuid].commit() diff --git a/changedetectionio/model/__init__.py b/changedetectionio/model/__init__.py index f42e199c..3c084d7c 100644 --- a/changedetectionio/model/__init__.py +++ b/changedetectionio/model/__init__.py @@ -187,7 +187,7 @@ class watch_base(dict): 'content-type': None, 'date_created': None, 'extract_text': [], # Extract text by regex after filters - 'browser_profile': None, # machine-name key of a BrowserProfile; None → resolve via chain + 'browser_profile': 'system', # machine-name key of a BrowserProfile; 'system' → resolve via chain 'fetch_backend': 'system', # plaintext, playwright etc 'fetch_time': 0.0, 'filter_failure_notification_send': strtobool(os.getenv('FILTER_FAILURE_NOTIFICATION_SEND_DEFAULT', 'True')), diff --git a/docs/api-spec.yaml b/docs/api-spec.yaml index fa8fcc8c..9c7998d2 100644 --- a/docs/api-spec.yaml +++ b/docs/api-spec.yaml @@ -316,17 +316,15 @@ components: type: string enum: [GET, POST, DELETE, PUT] description: HTTP method to use - fetch_backend: + browser_profile: type: string description: | - Backend to use for fetching content. Common values: - - `system` (default) - Use the system-wide default fetcher - - `html_requests` - Fast requests-based fetcher - - `html_webdriver` - Browser-based fetcher (Playwright/Puppeteer) - - `extra_browser_*` - Custom browser configurations (if configured) - - Plugin-provided fetchers (if installed) - pattern: '^(system|html_requests|html_webdriver|extra_browser_.+)$' - default: system + Browser profile (machine name) to use for fetching this watch. + - `null` or omitted — use the system default profile + - `direct_http_requests` — fast requests-based fetcher + - `browser_chromeplaywright` — Chrome/Playwright browser + - Any named profile configured in Settings → Browsers + - Plugin-provided profiles (e.g. CloakBrowser, if installed) headers: type: object additionalProperties: