зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1318070 - Make sure multi-word queries are rejected when keyword.enabled is false r=mak
MozReview-Commit-ID: 6kMU2oTy456 --HG-- extra : rebase_source : c666a23fb21326ba97ce665098240c9bf542553e
This commit is contained in:
Родитель
07c4d7dc13
Коммит
71da49f05f
|
@ -1569,6 +1569,20 @@ Search.prototype = {
|
|||
fixupInfo = Services.uriFixup.getFixupURIInfo(this._originalSearchString,
|
||||
flags);
|
||||
} catch (e) {
|
||||
if (e.result == Cr.NS_ERROR_MALFORMED_URI && !Prefs.keywordEnabled) {
|
||||
let value = PlacesUtils.mozActionURI("visiturl", {
|
||||
url: this._originalSearchString,
|
||||
input: this._originalSearchString,
|
||||
});
|
||||
this._addMatch({
|
||||
value,
|
||||
comment: this._originalSearchString,
|
||||
style: "action visiturl",
|
||||
frecency: 0,
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -141,6 +141,12 @@ add_task(function*() {
|
|||
searchParam: "enable-actions",
|
||||
matches: [ makeVisitMatch("bacon", "http://bacon/", { heuristic: true }) ]
|
||||
});
|
||||
do_print("visit two word query, keyword.enabled = false");
|
||||
yield check_autocomplete({
|
||||
search: "bacon lovers",
|
||||
searchParam: "enable-actions",
|
||||
matches: [ makeVisitMatch("bacon lovers", "bacon lovers", { heuristic: true }) ]
|
||||
});
|
||||
Services.prefs.setBoolPref("keyword.enabled", keywordEnabled);
|
||||
|
||||
do_print("visit url, scheme+host");
|
||||
|
|
Загрузка…
Ссылка в новой задаче