open-window on remote browsers

This commit is contained in:
David Botton 2021-03-24 18:13:37 -04:00
parent 9182c986f6
commit 49244b4a40
3 changed files with 18 additions and 1 deletions

View file

@ -111,6 +111,7 @@ function. If BOOT-FILE is nil path is removed."
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;
(defun open-browser (&key (url "http://127.0.0.1:8080")) (defun open-browser (&key (url "http://127.0.0.1:8080"))
"Open a web browser to URL." "Launch on os a web browser on local machine to URL. See BROWSER-OPEN
for openning windows on remote machines."
(trivial-open-browser:open-browser url)) (trivial-open-browser:open-browser url))

View file

@ -368,6 +368,21 @@ events and messages may not be trasmitted on most browsers."))
(defmethod resize-to ((obj clog-window) x y) (defmethod resize-to ((obj clog-window) x y)
(execute obj (format nil "resizeTo(~A,~A)" x y))) (execute obj (format nil "resizeTo(~A,~A)" x y)))
;;;;;;;;;;;;;;;;;
;; open-window ;;
;;;;;;;;;;;;;;;;;
(defgeneric open-window (clog-window url &key name specs replace)
(:documentation "This will launch a new window of current browser where
CLOG-WINDOW is displayed (remote or local). In modern browsers it is
very limitted to just open a new tab with url unless is a localhost url."))
(defmethod open-window ((obj clog-window) url &key
(name "_blank")
(specs "")
(replace "false"))
(execute obj (format nil "open('~A','~A','~A',~A)" url name specs replace)))
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;
;; close-window ;; ;; close-window ;;
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;

View file

@ -705,6 +705,7 @@ embedded in a native template application.)"
(print-window generic-function) (print-window generic-function)
(scroll-by generic-function) (scroll-by generic-function)
(scroll-to generic-function) (scroll-to generic-function)
(open-window generic-function)
(close-window generic-function) (close-window generic-function)
(close-connection generic-function) (close-connection generic-function)
(storage-type type) (storage-type type)