Skip to content

Browser lock-up/gray screen of death when running custom javascript #32

Description

@ahungry

Hi @joachifm, when I modify your #'simple-browser-main function as follows and run it (after loading the cl-webkit2 and simple-browser.lisp libraries) the browser opens, gives the alert, and then freezes as soon as I click on the alert (which does not close).

If I then tab off the alert to the browser, the browser grays out and is unusable (even a window manager kill command will not close it).

The modified function:

(defun simple-browser-main ()
  "A single-window browser with no keyboard or mouse input.                                                                    
Loads and renders a single web page."
  (gtk:within-main-loop
    (let ((win (make-instance 'gtk:gtk-window))
          (view (make-instance 'webkit2:webkit-web-view)))
      (gobject:g-signal-connect win "destroy"
                                #'(lambda (widget)
                                    (declare (ignore widget))
                                    (gtk:leave-gtk-main)))
      (gtk:gtk-container-add win view)
      (webkit2:webkit-web-view-load-uri view "http://www.example.com")
      (webkit2:webkit-web-view-run-javascript
       view
       "alert(1);"
       (cffi:null-pointer)
       (cffi:null-pointer)
       (cffi:null-pointer))
      (gtk:gtk-widget-show-all win))))

Please also find my own repository I wrote in C to make sure this was an issue with the cl-webkit bindings and not the underlying webkit2 libraries.

https://github.com/ahungry/puny-browser/blob/master/main.c

I'm running Arch Linux and it uses the 4.0.so file for webkit2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions