Skip to content

Commit

Permalink
fixes from latest nightly builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Quicksaver committed May 18, 2016
1 parent 80a4491 commit a9257a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
15 changes: 10 additions & 5 deletions resource/modules/content/mFinder.jsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VERSION 1.0.24
// VERSION 1.0.25

this.__defineGetter__('isPDFJS', function() { return Finder.isPDFJS; });

Expand Down Expand Up @@ -447,10 +447,15 @@ this.Finder = {
let nodes = $$("input, textarea", win.document);
for(let node of nodes) {
if(node instanceof Ci.nsIDOMNSEditableElement && node.editor) {
let sc = node.editor.selectionController;
selection = sc.getSelection(Ci.nsISelectionController.SELECTION_NORMAL);
if(selection.rangeCount && !selection.isCollapsed) {
break;
try {
let sc = node.editor.selectionController;
selection = sc.getSelection(Ci.nsISelectionController.SELECTION_NORMAL);
if(selection.rangeCount && !selection.isCollapsed) {
break;
}
}
catch(ex) {
// If this textarea is hidden, then its selection controller might not be intialized. Ignore the failure.
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion resource/modules/mFinder.jsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VERSION 1.0.14
// VERSION 1.0.15

this.SHORT_DELAY = 25;
this.LONG_DELAY = 1500;
Expand All @@ -19,6 +19,7 @@ this.__defineSetter__('highlightedText', function(v) { if(!gFindBarInitialized)
// Because I can't access Finder.jsm in its active context (for some reason), I need to completely replace it.
// A lot of the code here is based on http://mxr.mozilla.org/mozilla-central/source/toolkit/modules/RemoteFinder.jsm

XPCOMUtils.defineLazyModuleGetter(this, "Rect", "resource://gre/modules/Geometry.jsm");
XPCOMUtils.defineLazyGetter(this, "GetClipboardSearchString",
() => Cu.import("resource://gre/modules/Finder.jsm", {}).GetClipboardSearchString
);
Expand Down Expand Up @@ -49,6 +50,10 @@ this.RemoteFinder.prototype = {

this.addMessage("Result", (data) => {
this._searchString = data.searchString;
// The rect stops being a Geometry.jsm:Rect when the data object is sent from one process to another.
if(data.rect) {
data.rect = Rect.fromRect(data.rect);
}
return { callback: "onFindResult", params: [ data, this._browser ] };
});

Expand Down

0 comments on commit a9257a0

Please sign in to comment.