Index: chrome/content/ui/filters-search.js |
=================================================================== |
--- a/chrome/content/ui/filters-search.js |
+++ b/chrome/content/ui/filters-search.js |
@@ -139,18 +139,35 @@ FilterSearch.fakeBrowser = |
_resultListeners: [], |
searchString: null, |
caseSensitive: false, |
lastResult: null, |
_notifyResultListeners: function(result, findBackwards) |
{ |
this.lastResult = result; |
- for each (let listener in this._resultListeners) |
- listener.onFindResult(result, findBackwards); |
+ for (let listener of this._resultListeners) |
+ { |
+ // See https://bugzilla.mozilla.org/show_bug.cgi?id=958101, starting |
+ // with Gecko 29 only one parameter is expected. |
+ try |
+ { |
+ if (listener.onFindResult.length == 1) |
+ { |
+ listener.onFindResult({searchString: this.searchString, |
+ result: result, findBackwards: findBackwards}); |
+ } |
+ else |
+ listener.onFindResult(result, findBackwards); |
+ } |
+ catch (e) |
+ { |
+ Cu.reportError(e); |
+ } |
+ } |
}, |
fastFind: function(searchString, linksOnly, drawOutline) |
{ |
this.searchString = searchString; |
let result = FilterSearch.search(this.searchString, 0, |
this.caseSensitive); |
this._notifyResultListeners(result, false); |
@@ -173,16 +190,17 @@ FilterSearch.fakeBrowser = |
removeResultListener: function(listener) |
{ |
let index = this._resultListeners.indexOf(listener); |
if (index !== -1) |
this._resultListeners.splice(index, 1); |
}, |
// Irrelevant for us |
+ requestMatchesCount: function(searchString, matchLimit, linksOnly) {}, |
highlight: function(highlight, word) {}, |
enableSelection: function() {}, |
removeSelection: function() {}, |
focusContent: function() {}, |
keyPress: function() {} |
}, |
get _lastSearchString() |