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

Headless mode (#1354) rebase #2054

Closed
wants to merge 13 commits into from
Closed
10 changes: 8 additions & 2 deletions source/browser.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,16 @@ If nil, renderer-provided dialogs are used.")
:documentation "Ask whether to restore the session.
The possible values are `:always-ask', `:always-restore' and `:never-restore'.")
;; Hooks follow:
(after-startup-hook
(make-instance 'hooks:hook-void)
:type hooks:hook-void
:documentation "Hook run when the browser is started and ready for interaction.
The handlers take no argument.")
(before-exit-hook
(make-instance 'hooks:hook-void)
:type hooks:hook-void
:documentation "Hook run before both `*browser*' and the
renderer get terminated. The handlers take no argument.")
:documentation "Hook run before both `*browser*' and the renderer get terminated.
The handlers take no argument.")
(window-make-hook
(make-instance 'hook-window)
:type hook-window
Expand Down Expand Up @@ -324,6 +329,7 @@ prevents otherwise."))
(startup browser urls)))))))
;; Set `init-time' at the end of finalize to take the complete startup time
;; into account.
(hooks:run-hook (after-startup-hook *browser*))
aartaka marked this conversation as resolved.
Show resolved Hide resolved
(setf (slot-value *browser* 'init-time)
(local-time:timestamp-difference (local-time:now) startup-timestamp))
(setf (slot-value *browser* 'ready-p) t))
Expand Down