Mein Suchleisten-Script arbeitet nicht mehr im Nightly. Es wird kein neuer Tab geöffnet und die Suche wird auch nicht im alten Tab angestossen. Woran liegts?
JavaScript
/* Suchfeld automatisch leeren und in neuem Tab oeffnen */
(function() {
var searchbar = document.getElementById("searchbar");
searchbar.doSearch = function(aData, aWhere, aEngine, aParams, aOneOff) {
let textBox = this._textbox;
if (aData && !PrivateBrowsingUtils.isWindowPrivate(window) && this.FormHistory.enabled) {
this.FormHistory.update({
op: "bump",
fieldname: textBox.getAttribute("autocompletesearchparam"),
value: aData,
}, {
handleError(aError) {
Cu.reportError("Saving search to form history failed: " + aError.message);
},
});
}
let engine = aEngine || this.currentEngine;
let submission = engine.getSubmission(aData, null, "searchbar");
let telemetrySearchDetails = this.telemetrySearchDetails;
this.telemetrySearchDetails = null;
if (telemetrySearchDetails && telemetrySearchDetails.index == -1) {
telemetrySearchDetails = null;
}
const details = {
isOneOff: aOneOff,
isSuggestion: (!aOneOff && telemetrySearchDetails),
selection: telemetrySearchDetails,
};
BrowserSearch.recordSearchInTelemetry(engine, "searchbar", details);
let params = {
postData: submission.postData,
};
if (aParams) {
for (let key in aParams) {
params[key] = aParams[key];
}
}
openTrustedLinkIn(submission.uri.spec, "tab", params);
this.value = '';
this.currentEngine = this.engines ? this.engines[0] : this._engines[0];
};
}());
setTimeout(function() {
if (!window.BrowserSearch)
return;
var searchbar = BrowserSearch.searchBar;
if (!searchbar)
return;
var textbox = searchbar.textbox;
var tId;
textbox.addEventListener('input', function() {
clearTimeout(tId);
tId = setTimeout(function() {
textbox.value = '';
document.getElementById('PopupSearchAutoComplete').hidePopup();
}, 5000);
});
}, 0);
Alles anzeigen
Vielen Dank für Ideen!