Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
524 views
in Technique[技术] by (71.8m points)

html - Create Link to Embedded XML Search Engine Description

I want to create a single local HTML file that allows me to add a custom search engine to my Tor Browser.

https://github.com/adrw/torduckgo tells us how to do it with two files:

An HTML file with the special rel="search" link:

<html>
    <head>
        <link rel="search"
              type="application/opensearchdescription+xml"
              title="MySearch"
              href="http://link-to-my-search.xml">
    </head>
    <body/>
</html>

And the linked XML file:

<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>TorDuckGo</ShortName>
  ...
</OpenSearchDescription>

The problem: Tor Browser does not follow local links so opening the local HTML file will not see the XML file. Tor also does not access localhost. Thus I cannot serve these two files locally either.

I would like to embed the XML search specification inside the single HTML file and have the special rel="search" link point to it. This way I could open the local HTML file and it does not need to follow links. Is this possible?

Alternatively, can I use a different way to add the search engine? Instead of rel="search"?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...