Bug 1198688 - Disable option to show search suggestions in location bar in permanent private browsing mode. r=Mossop

This commit is contained in:
Drew Willcoxon 2015-09-16 15:59:16 -07:00
Родитель 62bdce4c80
Коммит 996aa36201
3 изменённых файлов: 34 добавлений и 10 удалений

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

@ -61,15 +61,35 @@ var gSearchPane = {
this._initAutocomplete();
let urlbarSuggests = document.getElementById("urlBarSuggestion");
urlbarSuggests.hidden = !Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete");
let suggestsPref =
document.getElementById("browser.search.suggest.enabled");
suggestsPref.addEventListener("change", () => {
this.updateSuggestsCheckbox();
});
this.updateSuggestsCheckbox();
},
let suggestsPref = document.getElementById("browser.search.suggest.enabled")
let updateSuggestsCheckbox = () => {
urlbarSuggests.disabled = !suggestsPref.value;
updateSuggestsCheckbox() {
let urlbarSuggests = document.getElementById("urlBarSuggestion");
urlbarSuggests.hidden =
!Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete");
let suggestsPref =
document.getElementById("browser.search.suggest.enabled");
let permanentPB =
Services.prefs.getBoolPref("browser.privatebrowsing.autostart");
urlbarSuggests.disabled = !suggestsPref.value || permanentPB;
let urlbarSuggestsPref =
document.getElementById("browser.urlbar.suggest.searches");
urlbarSuggests.checked = urlbarSuggestsPref.value;
if (urlbarSuggests.disabled) {
urlbarSuggests.checked = false;
}
suggestsPref.addEventListener("change", updateSuggestsCheckbox);
updateSuggestsCheckbox();
let permanentPBLabel =
document.getElementById("urlBarSuggestionPermanentPBLabel");
permanentPBLabel.hidden = urlbarSuggests.hidden || !permanentPB;
},
buildDefaultEngineDropDown: function() {

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

@ -41,12 +41,15 @@
label="&provideSearchSuggestions.label;"
accesskey="&provideSearchSuggestions.accesskey;"
preference="browser.search.suggest.enabled"/>
<hbox class="indent">
<vbox class="indent">
<checkbox id="urlBarSuggestion" label="&showURLBarSuggestions.label;"
hidden="true"
accesskey="&showURLBarSuggestions.accesskey;"
preference="browser.urlbar.suggest.searches"/>
</hbox>
<hbox id="urlBarSuggestionPermanentPBLabel"
align="center" class="indent">
<label flex="1">&urlBarSuggestionsPermanentPB.label;</label>
</hbox>
</vbox>
<checkbox id="redirectSearchCheckbox"
label="&redirectWindowsSearch.label;"
accesskey="&redirectWindowsSearch.accesskey;"

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

@ -11,6 +11,7 @@
<!ENTITY showURLBarSuggestions.label "Show search suggestions in location bar results">
<!ENTITY showURLBarSuggestions.accesskey "l">
<!ENTITY urlBarSuggestionsPermanentPB.label "Search suggestions will not be shown in location bar results because you have configured &brandShortName; to never remember history.">
<!ENTITY redirectWindowsSearch.label "Use this search engine for searches from Windows">
<!ENTITY redirectWindowsSearch.accesskey "W">