Live data from Hacker News

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

news.ycombinator.com

41–50 of 97 posts

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

#44

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

Please don't ever do that. I know one site that does this and I hate it.

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

#45
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.

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

#46

Earlier quoted context omitted.

> I'm not sure what the best-practice for a webapp designer is here? Perhaps intercepting Ctrl+F Oh god no, the solution is simple stop reimplementing the browser in the browser.

Google Drive does this within Google Chrome, fwiw. I don't disagree with the spirit of your comment though.

I'd say Google and Algolia are the only companies with the resources and know-how in search that can even think of this. And probably even they shouldn't.

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

#47
I had this exact problem yesterday while looking for someone in my list of Twitter people that I follow.

Also on YouTube when searching for something on my list of liked videos.

If you want to implement infinite scroll at least implement a damn search.

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

#48

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…

GitHub does this in workflow logs and it makes it impossible to copy/paste logs greater than the number of lines in your view.

Then you download the raw logs and every line has a timestamp so you need to write a shell command just to parse out the actual text you wanted to copy.

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

#49
post #28

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…

that's what discourse does. it's frustrating because it's significantly slower than the built-in browser search, probably in part due to excessive network accesses, but also probably due to poor caching and inefficient implementation.

I hate discourse's CTRL+F. When things like this happen I open the devtools and search in the dom, and it's a horrible experience too. I just don't want to learn each website's custom controls. Don't hijack my CTRL+F or my scrolling or anything else please!

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

#50
post #26

For reddit specifically, the answer seems to be to use "old.reddit.com" instead of "www.reddit.com". The is no general solution. Infinite scroll style web apps are implementing their own content view, in essence a web browser inside a web browser. It will never behave as users expect.

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`.
Post reply on HN