diff --git a/nyxt.asd b/nyxt.asd index b8e59bf6919..5e3074ec427 100644 --- a/nyxt.asd +++ b/nyxt.asd @@ -363,6 +363,7 @@ :components ((:file "renderer-package") (:file "renderer-offline/set-url") (:file "renderer-offline/execute-command-eval") + (:file "renderer-offline/register-custom-scheme") (:file "renderer-offline/nyxt-url-security") (:file "renderer-offline/search-buffer") ;; See https://github.com/atlas-engineer/nyxt/issues/3172 diff --git a/tests/renderer-offline/register-custom-scheme.lisp b/tests/renderer-offline/register-custom-scheme.lisp new file mode 100644 index 00000000000..425cf9a6158 --- /dev/null +++ b/tests/renderer-offline/register-custom-scheme.lisp @@ -0,0 +1,22 @@ +;;;; SPDX-FileCopyrightText: Atlas Engineer LLC +;;;; SPDX-License-Identifier: BSD-3-Clause + +(in-package :nyxt/tests/renderer) + +(nyxt:define-internal-scheme "test" + (lambda (url) + (declare (ignore url)) + (spinneret:with-html-string (:p (format nil "pass"))))) + +(define-test register-custom-scheme () + (let ((ready-channel (nyxt::make-channel 1))) + (nyxt:start :no-config t :no-auto-config t :headless t + :socket "/tmp/nyxt-test.socket" :profile "test") + (with-current-buffer (nyxt:make-buffer-focus :url "test:test") + (hooks:once-on (nyxt:buffer-loaded-hook (current-buffer)) (buffer) + (calispel:! ready-channel t)) + (calispel:? ready-channel) + (sleep 1) + (assert-equal "pass" + (nyxt:ps-eval (ps:chain (nyxt/ps:qs document "p") inner-text)))) + (nyxt:quit)))