ds300 / jetzt

Speed reader extension for chrome
Other
485 stars 124 forks source link

Improve element selection #90

Open nomicode opened 10 years ago

nomicode commented 10 years ago

Not sure about this, so just sketching out a few ideas.

Right now, when you try to select the body of an article, I find that usually only the paragraph I am moused over is selected, and I have to mess about trying to find a bit of the page that represents the parent element.

If you haven't used the Evernote web clipper, I recommend you install it just to see how they are doing it. When you click the Evernote button, it selects what it it thinks is the main piece of content (and usually gets this right).

I'm not sure how they do this. I think I saw some discussion about it recently. I remember someone saying that one approach is to look for the element with the most <p> elements in it, and then you select that by default.

But then you have the option of hitting + or - to expand or shrink the selection. You can also use the arrow keys to move around the page.

I have found that this is sufficient for most, if not all, things I want to clip. And perhaps a similar sort of thing would work well, or better, for us.

Note that with the Evernote web clipper, you can still select a bit of text, and activate the clipper, and it works like you would expect it to. But we already have that.

nomicode commented 10 years ago

screen shot 2014-03-17 at 14 54 09

Notice how the CSS of the selection is a bit nicer than we have it right now too.

peteruithoven commented 10 years ago

@nslater could you recheck how the current master works? David wrote a different selection method, one that selects the element you hover over and all the "siblings" that come next. This has the benefit that you can easily select a starting position.