This commit is contained in:
Sergey Trofimov 2026-01-07 16:36:09 -08:00 committed by GitHub
commit 2ca5ce4c67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View File

@ -605,3 +605,11 @@ def qute_start(_url: QUrl) -> _HandlerRet:
search_url=searchurl,
quickmarks=quickmarks)
return 'text/html', page
@add_handler("blank")
def qute_blank(_url: QUrl) -> _HandlerRet:
"""Handler for qute://blank."""
bgcolor = config.val.colors.webpage.bg
return "text/html", \
f'<html style="background-color: {bgcolor.name()}"/>'

View File

@ -340,3 +340,17 @@ class TestQuteConfigdiff:
url = QUrl('qute://configdiff/')
_mimetype, data = qutescheme.data_for_url(url)
assert data == b'content.images = false'
class TestBlankHandler:
"""Test the qute://blank handler."""
@pytest.fixture(autouse=True)
def prepare_config(self, config_stub):
config_stub.set_obj("colors.webpage.bg", "#101010")
def test_basic(self, config_stub):
url = QUrl("qute://blank")
_mimetype, data = qutescheme.qute_blank(url)
assert data == '<html style="background-color: #101010"/>'