Bug 1215948 - "Hey Cortana" searches in Windows 10 default to Bing. r=jaws

This commit is contained in:
Justin Dolske 2015-11-19 15:13:32 -08:00
Родитель fc20c6fef9
Коммит 21b9832692
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -784,14 +784,17 @@ nsDefaultCommandLineHandler.prototype = {
var params = new URLSearchParams(url.query);
// We don't want to rewrite all Bing URLs coming from external apps. Look
// for the magic URL parm that's present in searches from the task bar.
// (Typed searches use "form=WNSGPH", Cortana voice searches use "FORM=WNSBOX"
// for direct results, or "FORM=WNSFC2" for "see more results on
// Bing.com")
// * Typed searches use "form=WNSGPH"
// * Cortana voice searches use "FORM=WNSBOX" or direct results, or "FORM=WNSFC2"
// for "see more results on Bing.com")
// * Cortana voice searches started from "Hey, Cortana" use "form=WNSHCO"
// or "form=WNSSSV"
var allowedParams = ["WNSGPH", "WNSBOX", "WNSFC2", "WNSHCO", "WNSSSV"];
var formParam = params.get("form");
if (!formParam) {
formParam = params.get("FORM");
}
if (formParam == "WNSGPH" || formParam == "WNSBOX" || formParam == "WNSFC2") {
if (allowedParams.indexOf(formParam) != -1) {
var term = params.get("q");
var ss = Components.classes["@mozilla.org/browser/search-service;1"]
.getService(nsIBrowserSearchService);