Skip to content

Commit

Permalink
#106 fillTextFromEditable should respect HTML5 contenteditable
Browse files Browse the repository at this point in the history
  • Loading branch information
Quicksaver committed Sep 28, 2015
1 parent c17d8fa commit dc67e43
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions resource/modules/content/fillSelectedText.jsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Modules.VERSION = '2.0.5';
Modules.VERSION = '2.0.6';

this.selectedText = {
handleEvent: function(e) {
Expand Down Expand Up @@ -64,8 +64,12 @@ this.selectedText = {
// but we do want to erase the findbar when there's no text selection
if(selText && !Prefs.fillTextFromEditable) {
let focused = Finder.getFocused();
if(focused.element && focused.element instanceof Ci.nsIDOMNSEditableElement) {
return;
if(focused.element) {
// instances of any editable element (i.e. input,textarea) are of course editable
if(focused.element instanceof Ci.nsIDOMNSEditableElement) { return; }

// in HTML5, elements with contenteditable="true" are freely editable
if(trueAttribute(focused.element, 'contenteditable')) { return; }
}
}

Expand Down

0 comments on commit dc67e43

Please sign in to comment.