简体   繁体   English

Google Chrome如何建议网址完成?

[英]How does Google Chrome suggest url completions?

I've learned about Google's (unofficial) suggest API and their search API, which both look really great, but the suggest API doesn't actually suggest navigational completions. 我已经了解了Google的(非官方)建议API和他们的搜索API,它们看起来都很棒,但建议API实际上并没有建议导航完成。 On the other hand, in Google Chrome if you start to type for example "apple", it will suggest "www.apple.com/trailers". 另一方面,在谷歌浏览器中,如果您开始输入例如“apple”,则会建议“www.apple.com/trailers”。

I know it searches your browsing history, but I've never been to that page so it's not getting it locally. 我知道它会搜索您的浏览历史记录,但我从未去过该页面,所以它不会在本地获取。

Is this another unofficial secret API? 这是另一个非官方的秘密API吗?

If you use a transparent echoing proxy this can show you all http traffic Charles and fiddler are two good example, I recommend Charles. 如果您使用透明的回声代理,这可以向您显示所有的http流量Charlesfiddler是两个很好的例子,我推荐Charles。

Looking at new work traffic when I type "app" into chrome I see the following request 当我在chrome中输入“app”时查看新的工作流量,我看到以下请求

http://clients1.google.co.uk/complete/search?client=chrome&output=chrome&hl=en-US&q=app
GET /complete/search?client=chrome&output=chrome&hl=en-US&q=app HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.53 Safari/525.19
Accept-Encoding: gzip,deflate,bzip2,sdch
Cookie: SID=DQAAAIYAAAATI2S8dKFp5KGjAbyGxNaA4R4qbW24KzjW3jHTJOqIewCl64OqpBjnj7ReJ1aoFBA_rJ5h32jTrwD_xFTEgVfSqqXMfh_1e8bIcvLgz8qSRnXxWNUepTD90fXeHh0KfKtI9EkdkjgOPT2a9_1DJBlyzpOItI7o-fD5zQ6fjA9YdlC4TeCZqlsjbD6O8nXR5mg; PREF=ID=427f2a6420c4c235:U=19879741710226bb:TM=1224000168:LM=1240414461:S=kGvdcM6wirgoK_L7; NID=21=QOXGkbW3w-orrYC5IFOpPW9jEwdTz4oNJ6Pem0lcyFlvzxZHQgyYsf63kR2g4Pq62H0xWR8l7mF03GLgIJoPAZPIlMFG-ghig5ManOtWA7f3bqqq1eNtWSYyZYo4Ja5z
Accept-Language: en-US,en
Accept-Charset: ISO-8859-1,*,utf-8
Host: clients1.google.co.uk

With the response 随着回应

HTTP/1.1 200 OK
Content-Type: text/javascript; charset=utf-8
Date: Fri, 24 Apr 2009 08:06:54 GMT
Expires: Fri, 24 Apr 2009 09:06:54 GMT
Cache-Control: public, max-age=3600
Content-Encoding: gzip
Server: Auto-Completion Server
Content-Length: 175

["app",["http://www.apple.com/uk/","apple","apple store","apple trailers"],["Apple (United Kingdom)","437,000,000 results","37,700,000 results","995,000 results"],[],{"google:suggesttype":["NAVIGATION","QUERY","QUERY","QUERY"]}]

Charles knows about JSON so translates this into a pretty format Screen Shot Of Charles http://img2.imageshack.us/img2/2926/suggestionsforapp.png 查尔斯知道JSON,所以将其翻译成一个漂亮的格式Screen Shot Of Charles http://img2.imageshack.us/img2/2926/suggestionsforapp.png

See full size 查看完整尺寸

As you can see (easiest the full size image) this google service returned 4 results, one of type NAVIGATION( http://www.apple.com/uk/ ) and 3 of type QUERY(apple, apple store, apple trailers). 正如你所看到的(最简单的全尺寸图片),这个谷歌服务返回了4个结果,其中一个类型为NAVIGATION( http://www.apple.com/uk/ ),3个为QUERY类型(苹果,苹果商店,苹果拖车) 。 It also contains more information for each a description for the NAVIGATION result(Apple(United Kingdom)) and the number of results for each of the QUERY suggestions(437,000,000 37,700,00 995,000). 它还包含有关NAVIGATION结果(Apple(英国))的每个描述的更多信息以及每个QUERY建议(437,000,000 37,700,00 995,000)的结果数量。

Click Options , Under the Hood and you can see which services it searches for it's navigational selections. 单击选项在引擎盖下 ,您可以看到它搜索哪些服务的导航选择。 It sounds like it's combining history and search suggestions for you. 听起来它正在为您提供历史和搜索建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM