Live data from Hacker News

Ask HN: How do you search for $string if a webpage “supports” infinite scroll?

news.ycombinator.com

51–60 of 97 posts

Re: Ask HN: How do you search for $string if a webpage “supports” infinite scroll?

#51

If reddit is your only use case, there is always https://old.reddit.com/ ... until they take it down. I've see web apps with infinite scroll that will capture your Ctrl+F keypress and provides their own in-page text search tool (ex: https://i.imgur.com/BJPDDFw.png ) . I don't find it to be as easy/natural to use than the browsers build in text search, but it's better than broken text search.

No, I prefer a broken text search. You can have a custom search, I'm fine with it, but don't overwrite Ctrl+F

Re: Ask HN: How do you search for $string if a webpage “supports” infinite scroll?

#52
post #21
post #11

Go to Inspect element and do control + F to search for the string.

This still wont solve for lazy loading data on scroll, which is actually how its supposed to be done, to reduce load time, and dom draw together.

I don't understand what you mean but if the infinite scroll content has already been loaded, the HTML for the same will update in the element inspector as well and you can search for the string there. Of course it's hacky but I use this technique all the time.

Re: Ask HN: How do you search for $string if a webpage “supports” infinite scroll?

#53
I made a Firefox addon for myself that applies CSS to elements with text and/or attribute values that match a given regular expression. One of the first issues I ran into was that a lot of pages build their content via javascript so I added a delay to the scan. That mostly worked but the next issue (obvious in hindsight) was that can happen at any time, multiple times, for various reasons. That's when I learned about MutationObserver for the first time and it's worked pretty much perfectly since.

Here's the addon source [0]. I mostly (only) use the addon to style elements with links to sites I know I never want to visit, but it should work for this type of thing. However, the current UI isn't convenient for adding an adhoc rule.

[0] https://github.com/7w0/ssure/blob/4fd34677ad1c3f667ae85b939f...

Re: Ask HN: How do you search for $string if a webpage “supports” infinite scroll?

#54
post #6

You'd have the same problem with pagination, you'd need to Ctrl+f on each page. Solution? Use the website's search form.

Pagination is still preferable to infinite scrolling in my opinion, especially if it is reflected in the URL. Never actually found a positive example of infinite scrolling. It might be good for activities that are unfocused, but for anything else it is misplaced. For browsing images I could imagine use cases. But not for an archive on the other hand.

Re: Ask HN: How do you search for $string if a webpage “supports” infinite scroll?

#55
post #51

If reddit is your only use case, there is always https://old.reddit.com/ ... until they take it down. I've see web apps with infinite scroll that will capture your Ctrl+F keypress and provides their own in-page text search tool (ex: https://i.imgur.com/BJPDDFw.png ) . I don't find it to be as easy/natural to use than the browsers build in text search, but it's better than broken text search.

No, I prefer a broken text search. You can have a custom search, I'm fine with it, but don't overwrite Ctrl+F

Yes, I agree with you there. Don't overwrite my browser's shortcut keys.

Re: Ask HN: How do you search for $string if a webpage “supports” infinite scroll?

#58
post #20

Earlier quoted context omitted.

I agree with this. I feel like infinite scroll gets a bad rap. Pagination is no better. There are some sites and use cases where infinite scroll is a huge usability improvement. (I know -- pagination gives you a URL to a specific page of results. Who cares? When was the last time you deep-linked into a specific index page? Doing so is probably a bad idea, since when new content gets added, the contents of a specific…

Pagination is a lot better. In the example presented, most of the time the user just wants to find something on the front page. Nobody uses ctrl-F to search all of reddit.

The "front" page would be the default load of an infinite scroll, before anything has been added. Pagination or infinite scroll -- the initial load is likely the same.

Re: Ask HN: How do you search for $string if a webpage “supports” infinite scroll?

#59

I see lots of replies suggesting scrolling for a long time and then using CTRL+F. However, this won't work if the page is using virtualised scrolling (common with React et al. SPA for performance reasons, to avoid huge DOM trees as the page expands). The majority of content that is outside of the visible window will simply be unmounted from the DOM. I'm not sure what the best-practice for a webapp designer is here? P…

> Perhaps intercepting Ctrl+F and displaying a custom search that will do the correct filtering on the back-end and update/retarget the view? Stripe does this in their docs and I find it absolutely infuriating.

You can also use Ctrl+G

Re: Ask HN: How do you search for $string if a webpage “supports” infinite scroll?

#60
post #50

Earlier quoted context omitted.

This is a good answer that works in reddit, but if you change the user agent, it will work in almost any website with support for ie. IE6 User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) https://addons.mozilla.org/es/firefox/addon/uaswitcher/ This can be done with Selenium too. https://stackoverflow.com/questions/29916054/change-user-age...

You can set a custom UA in Firefox without an extension by going to about:config and adding the new UA as a string called `general.useragent.override`.

Yes you can, but with the addon it is easier, and you can set your custom user agents and store within, it is just for comfort.
Post reply on HN