Google 即搜即得如何更改浏览器发送的引荐来源网址?

发布于 2024-09-18 10:02:39 字数 305 浏览 5 评论 0原文

如果您点击 Google 即搜即得中的结果,您的浏览器发送到目标网站的引荐来源网址将包含一堆参数,其中包括所有重要的 q=[自动完成查询]

但您来自的页面的 URL 仅为 http://www.google.com/ 在 # 字符后面有一堆内容,即作为 on-页面锚点。

因此,浏览器似乎发送一个 URL 作为引用站点,该 URL 与您单击时查看的页面的 URL 不同。

似乎没有额外的重定向,那么他们到底是怎么做到的呢?

If you click on a result in Google Instant, the referer sent by your browser to the destination website contains a bunch of parameters, including the all important q=[autocompleted query]

But you're coming from a page whose URL is simply http://www.google.com/ with a bunch of stuff after the # character, i.e. as an on-page anchor.

So the browser appears to be sending a URL as the referer which is different from the URL of the page that you were viewing when you clicked.

There doesn't seem to be an additional redirection, so how on earth do they do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

清风挽心 2024-09-25 10:02:39

大多数时候,Google 搜索结果实际上会将您发送到 Google 重定向页面,而不是直接发送到目标页面。当您点击鼠标时,他们使用 JavaScript 来切换链接的目标。

您可以通过单击并按住搜索结果链接并观察状态栏来查看此效果。

这并不是 Google 即搜即得特有的,他们在标准结果页面上已经这样做了很长时间。

Most of the time, a Google search result actually sends you to a Google redirect page rather than directly to the target page. They use JavaScript to switch the target of the link onmousedown as you click on it.

You can see this effect by click-and-holding on the search result link and watching your status bar.

This isn't specific to Google Instant, they've been doing it for quite a long time on their standard results pages.

巴黎夜雨 2024-09-25 10:02:39

URL 的页面锚点部分可以在客户端进行操作,而无需向服务器发出新请求。即使谈论静态锚链接(例如 Section Foo),单击它们也不会导致向服务器发送新请求;它完全在浏览器内处理。

Google 用于使 Google Instant 工作的 JavaScript 只是在向服务器发出请求之前以编程方式更改锚点。

The page anchor part of the URL can be manipulated client-side without a new request to the server. Even when talking about static anchor links (e.g. <a href="#foo">Section Foo</a>), clicking on them does not cause a new request to be sent to the server; it is processed completely within the browser.

The javascript being used by Google to make Google Instant work is simply altering the anchor programatically before making a request to the server.

挥剑断情 2024-09-25 10:02:39

你用什么谷歌?

搜索后我的网址是这样的:

http://www.google.es/#sclient=psy&hl=es&q=something+to +search&aq=f&aqi=g4g-o1&aql=&oq=&gs_rfai=&pbx=1&fp=b0....

它确实包含 q=< /代码> 部分

What Google are you using?

My URL after searching is this:

http://www.google.es/#sclient=psy&hl=es&q=something+to+search&aq=f&aqi=g4g-o1&aql=&oq=&gs_rfai=&pbx=1&fp=b0....

It does include the q= part

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文