Bug 1441241. Reget a KeyboardEvent constructor on each findbar keypress, because the findbar lives across navigations. r=felipe

This commit is contained in:
Boris Zbarsky 2018-02-26 17:20:24 -05:00
Родитель 5588ef80d1
Коммит 895b88fb04
1 изменённых файлов: 2 добавлений и 5 удалений

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

@ -209,10 +209,6 @@ function RemoteFinderListener(global) {
this._finder = new Finder(global.docShell); this._finder = new Finder(global.docShell);
this._finder.addResultListener(this); this._finder.addResultListener(this);
this._global = global; this._global = global;
this.KeyboardEvent =
global.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow).KeyboardEvent;
for (let msg of this.MESSAGES) { for (let msg of this.MESSAGES) {
global.addMessageListener(msg, this); global.addMessageListener(msg, this);
@ -318,7 +314,8 @@ RemoteFinderListener.prototype = {
break; break;
case "Finder:KeyPress": case "Finder:KeyPress":
this._finder.keyPress(new this.KeyboardEvent("keypress", data)); var KeyboardEvent = this._finder._getWindow().KeyboardEvent;
this._finder.keyPress(new KeyboardEvent("keypress", data));
break; break;
case "Finder:MatchesCount": case "Finder:MatchesCount":