TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

101 pointsby zeta0x10about 5 years ago
Let&#x27;s say you visit a webpage like Reddit and want to search for $string. Maybe I am too stupid, but in my opinion it&#x27;s just not possible anymore. :( Content is dynamically loaded in and out and you have to scroll carefully not to miss a $string when using browser based CTRL-F. That is just ridiculous.<p>For me infinite-scroll is one of the most stupid features of the &quot;modern&quot; web. It just makes the experience <i>worse</i> to crank up some dubious engagement numbers.<p>And to make it clear: I don&#x27;t want to search for stuff via $string site:reddit.com via some search engine. Often I really want to search for <i>exact</i> $string on a page, but on something like Reddit that does not work anymore.<p>[&#x2F;rant]<p>EDIT: Thanks for all the answers. And I think I hit a nerve here :) Maybe it makes some frontend developers take a step back and really think if it&#x27;s really a good idea to implement that &quot;feature&quot;.<p>As suggested you can use old.reddit.com in case of Reddit, but for some pages, there just isn&#x27;t an option and the worst offenders even hijack your CTRL-F and want you to use their own terrible search.

32 comments

cronin101about 5 years ago
I see lots of replies suggesting scrolling for a long time and then using CTRL+F.<p>However, this won&#x27;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.<p>I&#x27;m not sure what the best-practice for a webapp designer is here? Perhaps intercepting Ctrl+F and displaying a custom search that will do the correct filtering on the back-end and update&#x2F;retarget the view? Azure DevOps does this but it&#x27;s still frustrating if your focused element is not within the capture point for the event.
评论 #22464396 未加载
评论 #22464395 未加载
评论 #22464553 未加载
评论 #22465260 未加载
评论 #22464346 未加载
评论 #22469635 未加载
评论 #22464303 未加载
评论 #22464569 未加载
评论 #22464454 未加载
xorcistabout 5 years ago
For reddit specifically, the answer seems to be to use &quot;old.reddit.com&quot; instead of &quot;www.reddit.com&quot;.<p>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.
评论 #22464370 未加载
评论 #22465359 未加载
评论 #22464508 未加载
combatentropyabout 5 years ago
Other problems:<p>- Scroll, scroll, scroll, and then click a link. Now click back. You have lost your place.<p>- How can anyone link to a section far down?<p>- Impossible to read or use anything in the footer. I suppose if you install infinite scrolling, you remove the footer. But I have heard a story where they forgot.
评论 #22464285 未加载
评论 #22467546 未加载
评论 #22464294 未加载
gcmrtcabout 5 years ago
You&#x27;d have the same problem with pagination, you&#x27;d need to Ctrl+f on each page.<p>Solution? Use the website&#x27;s search form.
评论 #22464237 未加载
评论 #22464680 未加载
评论 #22464213 未加载
评论 #22464223 未加载
dustedabout 5 years ago
Infinite scroll is one of those things that needs to die.
评论 #22470120 未加载
kgwxdabout 5 years ago
I made a Firefox addon for myself that applies CSS to elements with text and&#x2F;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&#x27;s when I learned about MutationObserver for the first time and it&#x27;s worked pretty much perfectly since.<p>Here&#x27;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&#x27;t convenient for adding an adhoc rule.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;7w0&#x2F;ssure&#x2F;blob&#x2F;4fd34677ad1c3f667ae85b939f08ea081a064e2c&#x2F;content&#x2F;content.js#L90" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;7w0&#x2F;ssure&#x2F;blob&#x2F;4fd34677ad1c3f667ae85b939f...</a>
klaustopherabout 5 years ago
What I have done in the past:<p>Scroll down a couple of days&#x2F;pages&#x2F;whatever and then use Ctrl+F. It‘s annoying as hell, but that usually works as most pages just add stuff at the bottom and don‘t unload the previous content on top
评论 #22464455 未加载
waltboszabout 5 years ago
If reddit is your only use case, there is always <a href="https:&#x2F;&#x2F;old.reddit.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;old.reddit.com&#x2F;</a> ... until they take it down.<p>I&#x27;ve see web apps with infinite scroll that will capture your Ctrl+F keypress and provides their own in-page text search tool (ex: <a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;BJPDDFw.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;BJPDDFw.png</a>) . I don&#x27;t find it to be as easy&#x2F;natural to use than the browsers build in text search, but it&#x27;s better than broken text search.
评论 #22464605 未加载
robbrown451about 5 years ago
You can paste something like this into your javascript console:<p>setInterval(function() { window.scrollTo(0, document.body.scrollHeight); }, 2000);<p>That will scroll continuously, so you can let it run for a while and then do ctrl-F. It might take a while but you can do something else. I&#x27;ve used it successfully many times (usually when I wanted to scrape the DOM for some reason or another, rather than just do a search).
评论 #22469806 未加载
评论 #22472096 未加载
mcvabout 5 years ago
The naive way is to scroll down a ridiculous amount and then do a simple ctrl-F. It would be nice if infinite-scroll sites provided their own search function that searched through all potential content for that page.<p>(And then probably provide those search results on an infinite-scroll page, requiring another search function to search through those search results. It&#x27;s infinite scroll all the way down.)
评论 #22464230 未加载
mygoabout 5 years ago
I’ve been finding it increasingly difficult to find blog templates that don’t do infinite scrolling with no way to turn it off. It’s not impossible, and most blog themes still have an option to turn it off if they’re included, but I’ve noticed it’s increasingly difficult to find themes without it. It seems to be the cool thing to do. But for setting up a static blog using the template, it’s a non-starter. Plus for all the aforementioned reasons: CTRL+F, linking to content, following a link and then going back, SEO (although some do SSR — still this is a non-starter for a statically published blog that just generates the pages using the theme)...
z3t4about 5 years ago
I open dev tools (or dev proxy) to see all the connections the site makes, grab the url to the &quot;page&quot; AJAX call. Put &#x27; (single quote) into the URL which then returns a SQL error. Then I make a SQL injection to make the page return everything. And search that.
strangattractorabout 5 years ago
Rendering with JS causes many difficulties. It often simply makes the content less useful - how do we index such a page for efficient discovery (search) for example. Running JS locally to render pages is problematic and often does not work.<p>I cannot tell you how many times I have gone to commerce sites that use infinite scroll - scroll down - click on and look at a product - back button to listing page returns to top of scrolling page making me scroll down again. What a waste of time.
luistricksabout 5 years ago
Hello friend, this is pretty simple, just change your user agent for this one:<p>Mozilla&#x2F;4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)<p>It&#x27;s ie 6 user agent with no support of js, so bye bye infinite scroll.
codegeekabout 5 years ago
I cannot think of one single use case where infinite scroll makes sense compared to plain old data tables that are paginated with server side search&#x2F;pagination built in.
评论 #22471822 未加载
kogirabout 5 years ago
I recall a time I scrolled through the whole page while using Fiddler or Burp as a proxy and then just searched the logged requests. Not pretty at all but it worked.
whb07about 5 years ago
reddit has a JSON api you can access with your credentials.
dyrlabout 5 years ago
More and more I feel like we should be simulating a human by macroing an actual typical web browser, including macroing the browser&#x27;s dev tools.<p>(When scraping is fragile and you may have to periodically maintain scripts anyway, this is my conclusion after trying to automate a React website using recently-mentioned lib taiko, and finding it to be hit &amp; miss, although it probably speaks more to my inexperience in general.)
INTPenisabout 5 years ago
This is a real interesting rant. I&#x27;ve definitely had this problem and wondered about the benefits of infinite scroll at those times. Also bad UX design.<p>I can&#x27;t offer anything besides the fact that I love my mouse which has this free roll toggle button. When I press that I can roll the wheel really fast and long without anything slowing it down.<p>But it&#x27;s sad that certain websites force users to such measures.
AznHisokaabout 5 years ago
I haven&#x27;t tested if this works for Reddit for some sites, if you use Opera, somehow they show you an &#x27;old&#x27; version of the site that doesn&#x27;t have auto-scrolling. I&#x27;m not sure why - perhaps it&#x27;s because there&#x27;s some kink in Opera that doesn&#x27;t support it, but it&#x27;s worth a try?
niceworkbuddyabout 5 years ago
Maybe try google with `site:` keyword. You can use also advance searching tools, so eg. you can search value to date.
评论 #22464159 未加载
reportgunnerabout 5 years ago
1. Click somewhere on the page so the scrolling works<p>2. Hold down Ctrl + End until a desired amount of pages loads<p>3. Ctrl + F to find $string
评论 #22464329 未加载
评论 #22464250 未加载
wiseleoabout 5 years ago
Seems like there’s opportunity for an extension to grab all text as it appears, store in client side DB, search that. I am going to build that as a feature in an extension I am working on to track all of my upvotes as automated bookmarks.
drejabout 5 years ago
Unless there&#x27;s a mobile site, I usually do this: I use my Logitech MX Master 2s, hit the scroller really hard to let it spin for a while thanks to inertia, triggering as many &quot;page&quot; events as possible :-)
pier25about 5 years ago
I had this exact problem yesterday while looking for someone in my list of Twitter people that I follow.<p>Also on YouTube when searching for something on my list of liked videos.<p>If you want to implement infinite scroll at least implement a damn search.
mwexlerabout 5 years ago
Hey, just like when you want to get to all the information in the footer like Contact Us, but the moment it appears, it gets scrolled away. I feel like a cat chasing a laser pointer.
u801eabout 5 years ago
On another note, infinite scrolling pages start using more and more memory as you scroll, which eventually requires closing the browser tab.
tuananhabout 5 years ago
Discourse (forum) used to hijack Ctrl+F (Command+F) shortcut which makes it super irritating! Not sure if they have changed that.
评论 #22474561 未加载
luistricksabout 5 years ago
Hello friend, yeah, there is an option, just change your user agent, tested in several sites and works...
winridabout 5 years ago
Use the search box, or figure out their API and use it directly.
buboardabout 5 years ago
switch to old reddit?<p>facebook, twitter etc have decided that their content is so low quality it&#x27;s not even worth searching so they re just not supporting it
bishalbabout 5 years ago
Go to Inspect element and do control + F to search for the string.
评论 #22464282 未加载
评论 #22464222 未加载
评论 #22464780 未加载