unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Derek Davies <ddavies@ddavies.net>
To: emacs-devel@gnu.org
Subject: eww/shr "inspector"
Date: Fri, 07 Feb 2020 15:47:03 -0500	[thread overview]
Message-ID: <87a75udt14.fsf@ddavies.net> (raw)


Hi, I'm new to this list, have searched, but not found, info on eww/shr
functionality for "inspcting".


Hi!  I'm new to this list, searched, but didn't find existing info.

I'm trying to get "inspector" functionality out of (or into) eww/shr.

So for any character position in an *eww* buffer one can find the stack
of dom references, , leaf to root, that produced the character at the
buffer position in question..

I've been hacking on this, but only since I haven't found this
functionality in any emacs package.  Please let me know if it exists.
If not, I'm happy to discuss if and how this might be implemented and
implement it.

So far, I've got hacks to eww source that attempt to use shr hooks to
get the start and end buffer positions of each dom node as shr renders them.

This stack of dom references and buffer position pairs can then be
queried to provide html/dom information corresponding to what has been
rendered at a given buffer position.  For instance, display the "path"
of html elements, from document root to leaf, responsible for what is
rendered at point in the *eww* buffer.

Then it's easy to have "jump to start of leaf html element in page source"

I see CSS related code in eww/shr in 26.3 and would also like to be able to
inspect based on CSS selectors.

It would be great to be able to do web dev in eww and have as much of
what, say, the Firefox inspector offors, as possible.

It would be very nice to not have to duplicate or tamper with eww/shr
source code and provide this as a separate package, of course.

Thanks in advance for your help and interest in this!  Hopefully someone
else has already done the work and you can point me to it :)

Derek



             reply	other threads:[~2020-02-07 20:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 20:47 Derek Davies [this message]
2020-02-10  5:34 ` eww/shr "inspector" Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a75udt14.fsf@ddavies.net \
    --to=ddavies@ddavies.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).