Mozilla Firefox質問スレッド Part133

このエントリーをはてなブックマークに追加
794名無しさん@お腹いっぱい。
>>789
// 検索履歴やsuggestの語句を「選ぶとすぐに検索」を止める
(function() {
function stopSearchByDropdownListOnClicked() {
const STOP_DND = true;
var searchBar = document.getElementById("searchbar");
if(!searchBar)return;
var textBox = document.getAnonymousElementByAttribute(searchBar, "anonid", "searchbar-textbox");
var old_onTextEntered = textBox.onTextEntered;
textBox.onTextEntered = function(aEvent) {
var evt = aEvent || this.mEnterEvent;
if (STOP_DND && aEvent && aEvent.type == "dragdrop"){
searchBar.removeAttribute('empty');
textBox.focus();
var evt = document.createEvent("UIEvents");
evt.initUIEvent("input", true, true, window, 0);
searchBar.dispatchEvent(evt);
return;
}
if (!evt) return;
if (!this.popupOpen) {
searchBar.handleSearchCommand(evt);
}
this.mEnterEvent = null;
}
}
stopSearchByDropdownListOnClicked();
document.getElementById("cmd_CustomizeToolbars").addEventListener("DOMAttrModified", function(e) {
if (e.attrName == "disabled" && !e.newValue)
stopSearchByDropdownListOnClicked();
}, false);
})();