Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's a crazy hack they could do to use ajax queries while preserving the current referer url:

Whenever the ajax search is performed an invisible iframe is loaded at: http://google.com/search?q=search+term&donothing=true.

The donothing=true tells Google's webserver to perform no actual query and return a blank page. This should happen extremely quickly. (It could be performed after the ajax results have been fully loaded as to not affect response time)

Then when a user clicks a search result, Google does a javascript redirect from the iframe (use javascript to add a new <script> tag with a window.top.location= in it) and you get a referer just like you would before... with a negligible performance hit.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: