import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -0,0 +1,3 @@
locale testsearchplugin ar jar:jar:searchTest.jar!/chrome/searchTest.jar!/
content testsearchplugin ./

View file

@ -0,0 +1,8 @@
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>addon</ShortName>
<Description>addon</Description>
<InputEncoding>UTF-8</InputEncoding>
<Url type="text/html" method="GET" template="http://searchtest.local">
<Param name="search" value="{searchTerms}"/>
</Url>
</SearchPlugin>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>TestEngineApp</ShortName>
<Description>A test search engine installed in the application directory</Description>
<InputEncoding>ISO-8859-1</InputEncoding>
<Url type="text/html" method="GET" template="http://localhost/" resultdomain="localhost">
<Param name="q" value="{searchTerms}"/>
</Url>
</SearchPlugin>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>engine-chromeicon</ShortName>
<Image width="16" height="16">chrome://branding/content/icon16.png</Image>
<Image width="32" height="32">chrome://branding/content/icon32.png</Image>
<Url type="text/html" method="GET" template="http://www.google.com/search">
<Param name="q" value="{searchTerms}"/>
</Url>
</SearchPlugin>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>Test search engine (fr)</ShortName>
<Description>A test search engine (based on Google search for a different locale)</Description>
<InputEncoding>ISO-8859-1</InputEncoding>
<Url type="text/html" method="GET" template="http://www.google.fr/search" resultdomain="google.fr">
<Param name="q" value="{searchTerms}"/>
<Param name="ie" value="iso-8859-1"/>
<Param name="oe" value="iso-8859-1"/>
</Url>
<SearchForm>http://www.google.fr/</SearchForm>
</SearchPlugin>

View file

@ -0,0 +1,8 @@
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>bug645970</ShortName>
<Description>override</Description>
<InputEncoding>UTF-8</InputEncoding>
<Url type="text/html" method="GET" template="http://searchtest.local">
<Param name="search" value="{searchTerms}"/>
</Url>
</SearchPlugin>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>engine-pref</ShortName>
<Url type="text/html" method="GET" template="http://www.google.com/search">
<Param name="q" value="{searchTerms}"/>
<!-- Dynamic parameters -->
<MozParam name="code" condition="pref" pref="code"/>
</Url>
</SearchPlugin>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>engine-rel-searchform-post.xml</ShortName>
<Url type="text/html" method="POST" template="http://engine-rel-searchform-post.xml/POST" rel="searchform"/>
<SearchForm>http://engine-rel-searchform-post.xml/?search</SearchForm>
</SearchPlugin>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>engine-rel-searchform-purpose</ShortName>
<Url type="text/html" method="GET" template="http://www.google.com/search" resultdomain="google.com" rel="searchform">
<Param name="q" value="{searchTerms}"/>
<!-- Dynamic parameters -->
<MozParam name="channel" condition="purpose" purpose="contextmenu" value="rcs"/>
<MozParam name="channel" condition="purpose" purpose="keyword" value="fflb"/>
<MozParam name="channel" condition="purpose" purpose="searchbar" value="sb"/>
</Url>
</SearchPlugin>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>engine-rel-searchform.xml</ShortName>
<Url type="text/html" method="GET" template="http://engine-rel-searchform.xml/?search" rel="searchform"/>
</SearchPlugin>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>engine-resourceicon</ShortName>
<Image width="16" height="16">resource://search-plugins/icon16.png</Image>
<Image width="32" height="32">resource://search-plugins/icon32.png</Image>
<Url type="text/html" method="GET" template="http://www.google.com/search">
<Param name="q" value="{searchTerms}"/>
</Url>
</SearchPlugin>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>engine-system-purpose</ShortName>
<Url type="text/html" method="GET" template="http://www.google.com/search">
<Param name="q" value="{searchTerms}"/>
<!-- Dynamic parameters -->
<MozParam name="channel" condition="purpose" purpose="searchbar" value="sb"/>
<MozParam name="channel" condition="purpose" purpose="system" value="sys"/>
</Url>
</SearchPlugin>

View file

@ -0,0 +1,10 @@
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>update</ShortName>
<Description>update</Description>
<InputEncoding>UTF-8</InputEncoding>
<Url type="text/html" method="GET" template="http://searchtest.local">
<Param name="search" value="{searchTerms}"/>
</Url>
<UpdateUrl>http://searchtest.local/opensearch.xml</UpdateUrl>
<IconUpdateUrl>http://searchtest.local/favicon.ico</IconUpdateUrl>
</SearchPlugin>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>Test search engine</ShortName>
<Description>A test search engine (based on Google search)</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQe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1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image>
<Url type="application/x-suggestions+json" method="GET" template="http://suggestqueries.google.com/complete/search?output=firefox&amp;client=firefox&amp;hl={moz:locale}&amp;q={searchTerms}"/>
<Url type="text/html" method="GET" template="http://www.google.com/search" resultdomain="google.com">
<Param name="q" value="{searchTerms}"/>
<Param name="ie" value="utf-8"/>
<Param name="oe" value="utf-8"/>
<Param name="aq" value="t"/>
<!-- Dynamic parameters -->
<MozParam name="channel" condition="purpose" purpose="contextmenu" value="rcs"/>
<MozParam name="channel" condition="purpose" purpose="keyword" value="fflb"/>
</Url>
<Url type="application/x-moz-default-purpose" method="GET" template="http://www.google.com/search" resultdomain="purpose.google.com">
<Param name="q" value="{searchTerms}"/>
<!-- MozParam uses searchbar if purpose is not specified -->
<MozParam name="channel" condition="purpose" purpose="searchbar" value="ffsb"/>
<MozParam name="channel" condition="purpose" purpose="contextmenu" value="rcs"/>
<MozParam name="channel" condition="purpose" purpose="keyword" value="fflb"/>
</Url>
<SearchForm>http://www.google.com/</SearchForm>
</SearchPlugin>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,22 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>IconsTest</ShortName>
<Description>IconsTest. Search by Test.</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,ico16</Image>
<Image width="32" height="32">data:image/x-icon;base64,ico32</Image>
<Image width="74" height="74">data:image/png;base64,ico74</Image>
<Url type="application/x-suggestions+json" template="http://api.bing.com/osjson.aspx">
<Param name="query" value="{searchTerms}"/>
<Param name="form" value="MOZW"/>
</Url>
<Url type="text/html" method="GET" template="http://www.bing.com/search">
<Param name="q" value="{searchTerms}"/>
<MozParam name="pc" condition="pref" pref="ms-pc"/>
<Param name="form" value="MOZW"/>
</Url>
<SearchForm>http://www.bing.com/search</SearchForm>
</SearchPlugin>

View file

@ -0,0 +1,54 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
/**
* Dynamically create a search engine offering search suggestions via searchSuggestions.sjs.
*
* The engine is constructed by passing a JSON object with engine datails as the query string.
*/
function handleRequest(request, response) {
let engineData = JSON.parse(unescape(request.queryString).replace("+", " "));
if (!engineData.baseURL) {
response.setStatusLine(request.httpVersion, 500, "baseURL required");
return;
}
engineData.name = engineData.name || "Generated test engine";
engineData.description = engineData.description || "Generated test engine description";
engineData.method = engineData.method || "GET";
response.setStatusLine(request.httpVersion, 200, "OK");
createOpenSearchEngine(response, engineData);
}
/**
* Create an OpenSearch engine for the given base URL.
*/
function createOpenSearchEngine(response, engineData) {
let params = "", queryString = "";
if (engineData.method == "POST") {
params = "<Param name='q' value='{searchTerms}'/>";
} else {
queryString = "?q={searchTerms}";
}
let result = "<?xml version='1.0' encoding='utf-8'?>\
<OpenSearchDescription xmlns='http://a9.com/-/spec/opensearch/1.1/'>\
<ShortName>" + engineData.name + "</ShortName>\
<Description>" + engineData.description + "</Description>\
<InputEncoding>UTF-8</InputEncoding>\
<LongName>" + engineData.name + "</LongName>\
<Url type='application/x-suggestions+json' method='" + engineData.method + "'\
template='" + engineData.baseURL + "searchSuggestions.sjs" + queryString + "'>\
" + params + "\
</Url>\
<Url type='text/html' method='" + engineData.method + "'\
template='" + engineData.baseURL + queryString + "'/>\
</OpenSearchDescription>\
";
response.write(result);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 B

View file

@ -0,0 +1,23 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>search-engine@tests.mozilla.org</em:id>
<em:unpack>true</em:unpack>
<em:version>1.0</em:version>
<em:targetApplication>
<Description>
<em:id>toolkit@mozilla.org</em:id>
<em:minVersion>0</em:minVersion>
<em:maxVersion>*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Front End MetaData -->
<em:name>Search Engine</em:name>
</Description>
</RDF>

View file

@ -0,0 +1 @@
# An invalid xml engine file.

View file

@ -0,0 +1,5 @@
{
"[app]/bug645970.xml": {
"alias": "lp"
}
}

View file

@ -0,0 +1,7 @@
{
"default": {
"visibleDefaultEngines": [
"engine", "engine-pref", "engine-rel-searchform-purpose", "engine-system-purpose", "engine-chromeicon", "engine-resourceicon"
]
}
}

View file

@ -0,0 +1,30 @@
{
"[global]": {
"searchdefaultexpir": 1471013469846
},
"[profile]\/engine.xml": {
"order": 1,
"alias": "foo"
},
"[app]\/google.xml": {
"order": 2
},
"[app]\/yahoo.xml": {
"order": 3
},
"[app]\/bing.xml": {
"order": 4
},
"[app]\/amazondotcom.xml": {
"order": 5
},
"[app]\/ddg.xml": {
"order": 6
},
"[app]\/twitter.xml": {
"order": 7
},
"[app]\/wikipedia.xml": {
"order": 8
}
}

View file

@ -0,0 +1,86 @@
{
"version": 1,
"buildID": "20121106",
"locale": "en-US",
"metaData": {},
"engines": [
{
"_name": "Test search engine",
"_shortName": "test-search-engine",
"description": "A test search engine (based on Google search)",
"extensionID": "test-addon-id@mozilla.org",
"__searchForm": "http://www.google.com/",
"_iconURL": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTz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r4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA",
"_metaData": {},
"_urls": [
{
"template": "http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&hl={moz:locale}&q={searchTerms}",
"rels": [
],
"type": "application/x-suggestions+json",
"params": [
]
},
{
"template": "http://www.google.com/search",
"resultDomain": "google.com",
"rels": [
],
"params": [
{
"name": "q",
"value": "{searchTerms}"
},
{
"name": "ie",
"value": "utf-8"
},
{
"name": "oe",
"value": "utf-8"
},
{
"name": "aq",
"value": "t"
},
{
"name": "channel",
"value": "fflb",
"purpose": "keyword"
},
{
"name": "channel",
"value": "rcs",
"purpose": "contextmenu"
}
]
},
{
"template": "http://www.google.com/search",
"resultDomain": "purpose.google.com",
"rels": [
],
"type": "application/x-moz-default-purpose",
"params": [
{
"name": "q",
"value": "{searchTerms}"
},
{
"name": "channel",
"value": "fflb",
"purpose": "keyword"
},
{
"name": "channel",
"value": "rcs",
"purpose": "contextmenu"
}
]
}
],
"queryCharset": "UTF-8",
"_readOnly": false
}
]
}

View file

@ -0,0 +1,78 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://gre/modules/Timer.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
/**
* Provide search suggestions in the OpenSearch JSON format.
*/
function handleRequest(request, response) {
// Get the query parameters from the query string.
let query = parseQueryString(request.queryString);
function writeSuggestions(query, completions = []) {
let result = [query, completions];
response.write(JSON.stringify(result));
return result;
}
response.setStatusLine(request.httpVersion, 200, "OK");
let q = request.method == "GET" ? query.q : undefined;
if (q == "no remote" || q == "no results") {
writeSuggestions(q);
} else if (q == "Query Mismatch") {
writeSuggestions("This is an incorrect query string", ["some result"]);
} else if (q == "Query Case Mismatch") {
writeSuggestions(q.toUpperCase(), [q]);
} else if (q == "") {
writeSuggestions("", ["The server should never be sent an empty query"]);
} else if (q && q.startsWith("mo")) {
writeSuggestions(q, ["Mozilla", "modern", "mom"]);
} else if (q && q.startsWith("I ❤️")) {
writeSuggestions(q, ["I ❤️ Mozilla"]);
} else if (q && q.startsWith("letter ")) {
let letters = [];
for (let charCode = "A".charCodeAt(); charCode <= "Z".charCodeAt(); charCode++) {
letters.push("letter " + String.fromCharCode(charCode));
}
writeSuggestions(q, letters);
} else if (q && q.startsWith("HTTP ")) {
response.setStatusLine(request.httpVersion, q.replace("HTTP ", ""), q);
writeSuggestions(q, [q]);
} else if (q && q.startsWith("delay")) {
// Delay the response by 200 milliseconds (less than the timeout but hopefully enough to abort
// before completion).
response.processAsync();
writeSuggestions(q, [q]);
setTimeout(() => response.finish(), 200);
} else if (q && q.startsWith("slow ")) {
// Delay the response by 10 seconds so the client timeout is reached.
response.processAsync();
writeSuggestions(q, [q]);
setTimeout(() => response.finish(), 10000);
} else if (request.method == "POST") {
// This includes headers, not just the body
let requestText = NetUtil.readInputStreamToString(request.bodyInputStream,
request.bodyInputStream.available());
// Only use the last line which contains the encoded params
let requestLines = requestText.split("\n");
let postParams = parseQueryString(requestLines[requestLines.length - 1]);
writeSuggestions(postParams.q, ["Mozilla", "modern", "mom"]);
} else {
response.setStatusLine(request.httpVersion, 404, "Not Found");
}
}
function parseQueryString(queryString) {
let query = {};
queryString.split('&').forEach(function (val) {
let [name, value] = val.split('=');
query[name] = unescape(value).replace(/[+]/g, " ");
});
return query;
}