OpenSearch描述文档发现和Chrome [英] OpenSearch description document discovery and Chrome

查看:147
本文介绍了OpenSearch描述文档发现和Chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试弄清楚如何使用OpenSearch宣传我的Web应用程序的搜索端点(请参阅 http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document ),但即使是我最简单的示例也无法使用.我有index.html与:

I'm trying to figure out how to advertise my web application's search endpoint using OpenSearch (see http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document), but even my simplest example does not work. I have index.html with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
    <head profile="http://a9.com/-/spec/opensearch/1.1/">
        <link title="Search" rel="search" type="application/opensearchdescription+xml" href="osdd.xml"/>
    </head>
    <body>
        hello
    </body>
</html>

osdd.xml包含:

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
    <ShortName>test</ShortName>
    <Description>test</Description>
    <Url type="text/html" template="http://example.com?q={searchTerms}"/>
</OpenSearchDescription>

但是似乎没有任何效果. Chrome的搜索选项卡"行为没有出现,并且使用开发人员工具Chrome似乎根本没有加载osdd.xml.

But nothing appears to work. Chrome's "tab to search" behavior does not show up, and using the developer tools Chrome does not seem to be loading osdd.xml at all.

有任何线索吗?

推荐答案

开发者工具">网络"选项卡上没有显示osdd.xml的加载.

Loading of the osdd.xml does not show up on the Developer Tools > Network tab.

http://code.google.com/p/chrome/issues/detail?id = 58801#c3 (评论3)提到您至少需要搜索一次才能添加搜索引擎.

http://code.google.com/p/chromium/issues/detail?id=58801#c3 (comment 3) mentions that you need to search at least once to add the search engine.

我还发现,您需要从设置">管理搜索引擎"中删除现有的搜索引擎,然后重新启动浏览器以查看对osdd文件所做更改的影响.

I also discovered that you need to delete existing search engines from the Settings > Manage Search Engines and restart the browser to see effects of changes to the osdd file.

这篇关于OpenSearch描述文档发现和Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆