{% extends 'base.html' %} {% block content %} {% from 'browsers-proxies-tabs.html' import browsers_proxies_tabs %} {# How many watches use a browser, linking to the watch list filtered to exactly those (?browser=, counted the same way - through group overrides and the system default) #} {% macro usage_chip(browser_id, usage) %} {% if usage.watches or usage.groups %} {{ usage.watches }} {% endif %} {% endmacro %} {# The default browser control: a radio per browser (one group across the page), drawn as a "Default" badge when chosen and a quiet "Make default" otherwise. Each sits in its own mini-form so it posts its own set-default action. #} {% macro default_toggle(browser_id) %}
{% endmacro %}
{{ browsers_proxies_tabs(active='browsers') }}

{{ _('Browsers') }}

{% if browser_config_locked() %}

{{ _('These are the available browsers. Adding, editing and removing browsers is locked on this instance — you can still choose the default browser below.') }}

{% else %}

{{ _('Browsers fetch your pages. Choose the default, or save your own variation of one with a different screen size, language or timezone.') }}

{% endif %}
{{ _('How this works') }}

{{ _('The default browser is used by every watch, unless the watch or its group picks another one.')|safe }}

{{ _('A variation is a browser with your own settings saved under a name, ready to use on any watch or group.')|safe }}

{# One card per available browser, its variations listed inside it. Each part keeps its own class - the regions col-default / col-browser / col-capabilities / col-actions, every card and variation its engine (browser-engine-), every chip what it shows (browser-chip--cap-, browser-chip--) - so a deployment can hide any of them with CSS alone. #} {% if base_fetchers %}
{% for f in base_fetchers %} {% set f_is_default = f.ready_to_use and f.name == default_browser_id %}
{# ---- The browser itself ---- #}
{# The fetcher's own icon (built-in or from a plugin), else a generic one #} {%- set fetcher_icon = f.name|fetcher_status_icons -%} {%- if fetcher_icon %}{{ fetcher_icon }}{% else %}{% endif -%}

{{ f.description }}

{# Only the capabilities a user picks a browser by - FetcherCapabilities.chips() #} {% for chip in f.capability_chips %} {{ chip.label }} {% endfor %} {% if not f.is_browser %}{{ _('plain text, no JavaScript') }}{% endif %} {{ usage_chip(f.name, f.usage) }}
{# Only ready-to-use browsers can be the default (base-only ones work through a variation) #} {% if f.ready_to_use %}{{ default_toggle(f.name) }} {% elif f.needs_setup %}{{ _('needs setup') }}{% endif %}
{# When browser config is locked, only setting the default is allowed #} {% if not browser_config_locked() and f.ready_to_use and f.configurable %} {{ _('Edit') }} {% endif %}
{# ---- Its variations, hung off the browser as a tree so they read as its children ---- #} {% set can_add = not browser_config_locked() and f.configurable %} {% if f.variations or can_add %}
{% if f.variations %}
{{ _('Variations') }}
    {% for v in f.variations %} {% set bc = v.get('browser_config') or {} %} {# Still chosen by a watch or group, or the default: removing it would break them #} {% set in_use = v.usage.watches or v.usage.groups %} {# id: its name as an anchor, so other pages can point at this row (it is then highlighted) #}
  • {# The icon of the browser this variation runs - the fetcher resolves it from the settings #} {%- set variation_icon = f.name|fetcher_status_icons(bc) -%} {%- if variation_icon %}{{ variation_icon }}{% else %}{% endif -%}
    {{ v.get('label') }}
    {% for chip in v.summary %} {%- if chip.flag %}{% else %}{% endif -%} {{ chip.text }} {% endfor %} {{ usage_chip(v.id, v.usage) }}
    {{ default_toggle(v.id) }}
    {% if not browser_config_locked() %} {{ _('Edit') }} {% if in_use or v.id == default_browser_id %} {% else %}
    {% endif %} {% endif %}
  • {% endfor %}
{% endif %} {# "Add variation" for any configurable browser - real browsers or the plain client #} {% if can_add %} {{ _('Add variation') }} {% endif %}
{% endif %}
{% endfor %}
{% else %}

{{ _("No interactive browser is available.") }}

{{ _('Connect a Chrome/Playwright browser (e.g. set PLAYWRIGHT_DRIVER_URL) or install the Playwright library to configure browsers here.')|safe }}

{% endif %}
{# Edit / Add variation open here (links marked data-browser-config-modal); without JavaScript they stay ordinary links to the same form as a page #}
{% endblock %}