{% extends "styled.html" %}

{% block style %}
{{super()}}
.note {
    font-size: smaller;
    color: grey;
}

.mono {
    font-family: monospace;
}
{% endblock %}

{% block content %}
<h1>Legacy QtWebKit backend</h1>

<span class="note">Note this warning will only appear once. Use <span class="mono">:open
qute://backend-warning</span> to show it again at a later time.</span>

<p>
    You're using qutebrowser with the legacy QtWebKit backend. It's still the
    default until a few remaining issues are sorted out. If you can, it's
    strongly suggested to switch earlier, as legacy QtWebKit has known security
    issues and also breaks things on various websites.
</p>

<h2>Using QtWebEngine instead</h2>

<span class="note">This is usually the better choice if you aren't using Nouveau graphics, and
don't need any features which are currently unavailable with QtWebEngine (like
the <span class="mono">qute://settings</span> page or caret browsing).</span>

{% macro install_webengine(package) -%}
    You should be able to install <span class="mono">{{ package }}</span> and start qutebrowser with <span class="mono">--backend webengine</span> to use the new backend.
{%- endmacro %}

{% macro please_open_issue() -%}
    If you know more, please <a href="https://github.com/qutebrowser/qutebrowser/issues/new">open an issue</a>!
{%- endmacro %}

{% macro unknown_system() -%}
    There's no information available for your system. {{ please_open_issue() }}
{%- endmacro %}

<p>
{% if distribution.parsed == Distribution.ubuntu %}
    {% if distribution.version == none %}
        {{ unknown_system() }}
    {% elif distribution.version >= version('17.04') %}
        {{ install_webengine('python3-pyqt5.qtwebengine') }}
    {% elif distribution.version >= version('16.04') %}
        QtWebEngine is only available in Ubuntu's repositories since 17.04, but you can <a href="https://github.com/qutebrowser/qutebrowser/blob/master/INSTALL.asciidoc#installing-qutebrowser-with-tox">install qutebrowser via tox</a> with <span class="mono">tox -e mkvenv-pypi</span> to use the new backend.
    {% else %}
        Unfortunately, no easy way is known to install QtWebEngine on Ubuntu &lt; 16.04. {{ please_open_issue() }}
    {% endif %}
{% elif distribution.parsed == Distribution.debian %}
    {% if distribution.version == none %}
        {{ unknown_system() }}
    {% elif distribution.version >= version('9') %}
        {{ install_webengine('python3-pyqt5.qtwebengine') }}
    {% else %}
        Unfortunately, no easy way is known to install QtWebEngine on Debian &lt; 9. {{ please_open_issue() }}
    {% endif %}
{% elif distribution.parsed in [Distribution.arch, Distribution.manjaro] %}
    {{ install_webengine('qt5-webengine') }}
{% elif distribution.parsed == Distribution.void %}
    {{ install_webengine('python-PyQt5-webengine') }}
{% elif distribution.parsed == Distribution.fedora %}
    {{ install_webengine('qt5-qtwebengine') }}
{% elif distribution.parsed == Distribution.opensuse %}
    {{ install_webengine('libqt5-qtwebengine') }}
{% elif distribution.parsed == Distribution.gentoo %}
    {{ install_webengine('dev-qt/qtwebengine') }}
{% else %}
    {{ unknown_system() }}
{% endif %}
</p>

<h2>Using QtWebKit-NG instead</h2>

<span class="note">This is a drop-in replacement for legacy QtWebKit.</span>

<p>
{% if distribution.parsed == Distribution.debian and distribution.version != none and distribution.version >= version('9') %}
    There are unofficial QtWebKit-NG packages <a href="http://repo.paretje.be/unstable/">available</a>.
{% elif distribution.parsed in [Distribution.ubuntu, Distribution.debian] %}
    No easy way is known to install QtWebKit-NG on your system.
    There are unofficial QtWebKit-NG packages <a href="http://repo.paretje.be/unstable/">available</a>, but they are intended for Debian Unstable.
    {{ please_open_issue() }}
{% elif distribution.parsed in [Distribution.arch, Distribution.manjaro] %}
    With an updated <span class="mono">qt5-webkit</span> package, you should already get QtWebKit-NG.
{% elif distribution.parsed == Distribution.gentoo %}
    There's an unofficial <a href="https://gist.github.com/annulen/309569fb61e5d64a703c055c1e726f71">ebuild</a> available.
{% else %}
    {{ unknown_system() }}
{% endif %}
</p>

{% endblock %}
