Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty URL displayed during website loading #791

Closed
aartaka opened this issue Jun 15, 2020 · 2 comments
Closed

Empty URL displayed during website loading #791

aartaka opened this issue Jun 15, 2020 · 2 comments

Comments

@aartaka
Copy link
Contributor

aartaka commented Jun 15, 2020

Describe the bug

When the request-resource-hook is not in its default state and one of the
handlers in it get activated, the Loading "websitename.foo" string
(that always get displayed when URL loads) looks likeLoading "". instead.

This message comes from the renderer-gtk.lisp file,
from the on-signal-load-changed method. It gets displayed in the modeline
during the website loading. with the contents of the url slot of the
current buffer, prettified with url-display. Because format uses a standart
form of what's inside ("~s") and url-display returns either a decoded
or an original URL, the url slot of the given buffer is empty.

Probably, the root of the problem is somewhere in the on-signal-decide-policy
method that treats the cases of the URL change specially, but I can't understand
exactly where URL gets erased, especially given that the erasure is temporary
and URL is back on the :webkit-load-finished phase (it is displayed).

Precise recipe to reproduce the issue

Having an old-reddit-handler (the one from the manual)
in the default buffer request-resource-hook,
call set-url-from-current-url, input reddit.com and hit Return.
Look at the modeline -- there will be a Loading "". string,
until the website will load.

Minimal config file to reproduce the issue:

(in-package #:nyxt-user)

(defun old-reddit-handler (request-data)
  (let* ((url (url request-data))
         (uri (quri:uri url)))
    (setf (url request-data)
          (if (search "reddit.com" (quri:uri-host uri))
              (progn
                (setf (quri:uri-host uri) "old.reddit.com")
                (let ((new-url (quri:render-uri uri)))
                  (log:info "Switching to old Reddit: ~a" new-url)
                  new-url))
              url)))
  request-data)

(define-configuration buffer
  ((request-resource-hook (hooks:add-hook %slot-default
                                          (make-handler-resource #'old-reddit-handler)))))

Information

  • OS name+version:
    Guix System (version 58cb52a31d5fd6c303440bf2fb900a267734d106), Linux 5.4.45 #1 SMP 1

  • Graphics card and driver (output of lspci -v):

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07) (prog-if 00 [VGA controller])
	Subsystem: ASUSTeK Computer Inc. Device 1c50
	Flags: bus master, fast devsel, latency 0, IRQ 126
	Memory at ee000000 (64-bit, non-prefetchable) [size=16M]
	Memory at d0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at f000 [size=64]
	Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: i915
	Kernel modules: i915
  • Desktop environment / Window manager name+version:
    StumpWM 19.11
    *version* = "1.0.1 Compiled On Wed Jun 03 2020 21:26:36"

  • How you installed Nyxt (Guix pack, package manager, build from source):
    Loaded dependencies from /nyxt/build-scripts/guix.scm, loaded the :nyxt/gtk system in SLIME REPL.

  • Information from command copy-system-information:

Nyxt Version: 1.5.0-781c4a1a 
Lisp Implementation: SBCL 
Lisp Version: 2.0.5 
Operating System: Linux 5.4.45 
Features: (WEBKIT2 WEBKIT2-2.28 WEBKIT2-EMOJI WEBKIT2-MEDIA WEBKIT2-SANDBOXING
           GTK-3-22 GTK-3-20 GTK-3-18 GTK-3-16 GTK-3-14 GTK-3-12 GTK-3-10
           GTK-3-8 GTK-3-6 GTK-3-4 GTK GDK-3-22 GDK-3-20 GDK-3-18 GDK-3-16
           GDK-3-14 GDK-3-12 GDK-3-10 GDK-3-8 GDK-3-6 GDK-3-4 CAIRO-1-10
           CAIRO-1-12 GDK-PIXBUF GLIB-2-30 GLIB-2-32 GLIB-2-34 GLIB-2-36
           GLIB-2-38 GLIB-2-40 GLIB-2-42 GLIB-2-44 GLIB-2-46 GLIB-2-48
           GLIB-2-50 GLIB-2-52 GLIB-2-54 GLIB-2-56 GLIB-2-58 GLIB
           FSET-EXT-STRINGS PLUMP-UTF-32 GLOBAL-VARS DECLARE-TYPES PARENSCRIPT
           NAMED-READTABLES OSICAT-FD-STREAMS LPARALLEL 21BIT-CHARS CL-FAD
           CHUNGA FLEXI-STREAMS CLOSER-MOP CL-PPCRE-UNICODE CL-UNICODE CL-PPCRE
           BORDEAUX-THREADS LPARALLEL.WITH-CLTL2 LPARALLEL.WITH-CAS
           LPARALLEL.WITH-STEALING-SCHEDULER SPLIT-SEQUENCE FLAT-NAMESPACE
           X86-64 UNIX CFFI FLAT-NAMESPACE SEQUENCE-EMPTYP
           ASDF-SYSTEM-CONNECTIONS CL-JSON-CLOS CL-JSON THREAD-SUPPORT SWANK
           QUICKLISP ASDF3.3 ASDF3.2 ASDF3.1 ASDF3 ASDF2 ASDF OS-UNIX
           NON-BASE-CHARS-EXIST-P ASDF-UNICODE X86-64 GENCGC 64-BIT ANSI-CL
           COMMON-LISP ELF IEEE-FLOATING-POINT LINUX LITTLE-ENDIAN
           PACKAGE-LOCAL-NICKNAMES SB-CORE-COMPRESSION SB-LDB SB-PACKAGE-LOCKS
           SB-THREAD SB-UNICODE SBCL UNIX)

Output when started from a shell

Nyxt version 1.5.0-781c4a1a
<INFO> [20:47:35] Loading Lisp file "/home/aartaka/.config/nyxt/init.lisp".
<INFO> [20:47:35] Using data profile "default".
<INFO> [20:47:35] Listening to socket "/home/aartaka/.local/share/nyxt/nyxt.socket".
NIL
<INFO> [20:47:39] Loading global history of 19 URLs from "/home/aartaka/.local/share/nyxt/history.lisp".
<INFO> [20:47:43] Saving session to "/home/aartaka/.local/share/nyxt/sessions/default.lisp".
<INFO> [20:47:43] Switching to old Reddit: https://old.reddit.com/
<INFO> [20:47:43] Saving session to "/home/aartaka/.local/share/nyxt/sessions/default.lisp".
<INFO> [20:47:43] Switching to old Reddit: https://old.reddit.com/
<INFO> [20:47:43] Loading "".
<INFO> [20:47:45] Switching to old Reddit: https://old.reddit.com/
<INFO> [20:47:45] Saving session to "/home/aartaka/.local/share/nyxt/sessions/default.lisp".
<INFO> [20:47:45] Saving session to "/home/aartaka/.local/share/nyxt/sessions/default.lisp".
<INFO> [20:47:48] Deleting socket /home/aartaka/.local/share/nyxt/nyxt.socket
<INFO> [20:47:48] Finished loading "https://old.reddit.com/".
@Ambrevar
Copy link
Member

Ambrevar commented Jun 15, 2020 via email

@Ambrevar
Copy link
Member

Oh! This was subtle... ;)
Look at 33a2610.
Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants