Making usage of Google Chrome's OmniBox [TAB] Feature for/on personal website?

杀马特。学长 韩版系。学妹 提交于 2019-12-02 18:24:29

I've compared what you have against the OpenSearchDescription on my own site and I cannot see why yours is not working. The only real difference is that you are using POST to search whereas I am using GET. According to this page, IE7 does not support POST requests, so it may be that other browsers also do not support POST.

The one on my site definitely works in IE8, Chrome 3.0 and FF 2.0+. Feel free to compare them yourself and see if you can spot a difference: opensearch.XML

Getting OSD (OpenSearchDescription) work under Google Chrome or IE7 / IE8 isn't as difficult as mentioned or that these browsers don't support POST requests.

With a little bit of tweaking, I found a workaround to the entire problem.

My initial code:

<Url type="text/html" method="POST" template="http://MySite.com/query.php">
  <Param name="sString" value="{searchTerms}"/>
</Url>

This code points directly to the query page and passes the value for the sString attribute on my POST request.

That works perfectly on FireFox but doesn't quite work well on IE7/IE8 or Google Chrome (I didn't test with Opera or Safari yet..).


Altering the code to the following piece:

<Url type="text/html" template="http://MySite.com/query.php?sString={searchTerms}"></Url>
  • Removing method="POST" from the element
  • Replacing /query.php with the actual page call: /query.php?sString={searchTerms}
  • Removing the now unnecessary "<Param name="sString" value="{searchTerms}"/>"

Resolved my problem of incompatibility with those browsers.

All calls are directly headed to the query page and even it initially was a POST request, it now work on both IE7/IE8 and Google Chrome.

Thanks again adrianbanks for providing me with your xml file which led to the solution!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!