From 895b88fb04d2a913a2f4beb84625ec8361e16f0d Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 26 Feb 2018 17:20:24 -0500 Subject: [PATCH] Bug 1441241. Reget a KeyboardEvent constructor on each findbar keypress, because the findbar lives across navigations. r=felipe --- toolkit/modules/RemoteFinder.jsm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/toolkit/modules/RemoteFinder.jsm b/toolkit/modules/RemoteFinder.jsm index b6c5902f96cf..8c107bf1d640 100644 --- a/toolkit/modules/RemoteFinder.jsm +++ b/toolkit/modules/RemoteFinder.jsm @@ -209,10 +209,6 @@ function RemoteFinderListener(global) { this._finder = new Finder(global.docShell); this._finder.addResultListener(this); this._global = global; - this.KeyboardEvent = - global.docShell - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindow).KeyboardEvent; for (let msg of this.MESSAGES) { global.addMessageListener(msg, this); @@ -318,7 +314,8 @@ RemoteFinderListener.prototype = { break; 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; case "Finder:MatchesCount":