News for hackers. Stuff that matters.
Re:Theheadless.dev – open source Puppeteer and Playwright kn... by ethbro on Wednesday August 19, 2020 @10:12AM (#24210532)
That's a use case I haven't encountered, nor considered!

Most of my work is making known transitions (e.g. page1 to page2) work reliably, so I have the benefit of knowing the landing page structure.

If you're crawling pathological, client-side redirect chains, maybe do pattern-matching scans on loaded code for the full set of redirect methods? There's only so many, and includes / doesn't-include seems a fair way to bucket pages.

Re:Theheadless.dev – open source Puppeteer and Playwright kn... by luckylion on Wednesday August 19, 2020 @10:58AM (#24211013)
Yeah, we had been doing that initially and found that there are lots of imaginative ways to use e.g. refresh meta-tags that browsers do accept but we did not (e.g. somebody might say content="0.0; url=https://example.com/"*) and more and more networks and agencies switching to JS-based redirects lead to a headless browser being easier in the end, despite dealing with these specific issues.

A simple self.location.href = ...* is still doable (-ish, because I've seen conditional changes that were essentially if(false)... to disable a redirect, which we obviously didn't consider when pattern matching), but once they include e.g. jQuery (and some do on a simple redirect page) it got far too complicated.