emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eww and bookmarks


From: Tomas Hlavaty
Subject: Re: eww and bookmarks
Date: Sun, 07 Jun 2020 18:36:05 +0200

Michael Heerdegen <michael_heerdegen@web.de> writes:
> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>
>> There's eww-after-render-hook.  Sample usage:
>> https://emacs.stackexchange.com/a/36287/15748
>
> Yes, I know about the hook.  But just binding it will not be enough
> because the binding will be gone when it is consulted.  We would have to
> add a self-removing function at least to the local binding of the hook.
> That's what I would call a hack.

eww-after-render-hook does not seem to be useable because it runs in the
wrong buffer at the wrong time.

I hit the issue when implementing the following use-case:

1) Open login page URL
2) Automatically fill in username and password
3) Automatically submit the login form

My workaround something like this:

(defun login-fn-delayed ()
  (with-current-buffer "*eww*"
    (fill-in-username-and-password)
    (submit-login-form)))

(defun login-fn ()
  (interactive)
  (eww some-url)
  (run-with-timer "1 sec" nil 'login-fn-delayed))

It would be nice, if there was no need for run-with-timer and no need
for (with-current-buffer "*eww*"...).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]