diff --git a/toolkit/modules/Finder.jsm b/toolkit/modules/Finder.jsm index 3abbf62fa2e..59286d47d1b 100644 --- a/toolkit/modules/Finder.jsm +++ b/toolkit/modules/Finder.jsm @@ -197,9 +197,12 @@ Finder.prototype = { // Allow Finder listeners to cancel focusing the content. for (let l of this._listeners) { try { - if (!l.shouldFocusContent()) + if ("shouldFocusContent" in l && + !l.shouldFocusContent()) return; - } catch (ex) {} + } catch (ex) { + Cu.reportError(ex); + } } let fastFind = this._fastFind; diff --git a/toolkit/modules/RemoteFinder.jsm b/toolkit/modules/RemoteFinder.jsm index 9899160e0df..768b120a6c4 100644 --- a/toolkit/modules/RemoteFinder.jsm +++ b/toolkit/modules/RemoteFinder.jsm @@ -83,6 +83,17 @@ RemoteFinder.prototype = { }, focusContent: function () { + // Allow Finder listeners to cancel focusing the content. + for (let l of this._listeners) { + try { + if ("shouldFocusContent" in l && + !l.shouldFocusContent()) + return; + } catch (ex) { + Cu.reportError(ex); + } + } + this._browser.messageManager.sendAsyncMessage("Finder:FocusContent"); }, @@ -134,12 +145,6 @@ RemoteFinderListener.prototype = { this._global.sendAsyncMessage("Finder:MatchesResult", aData); }, - //XXXmikedeboer-20131016: implement |shouldFocusContent| here to mitigate - // issues like bug 921338 and bug 921308. - shouldFocusContent: function () { - return true; - }, - receiveMessage: function (aMessage) { let data = aMessage.data;