From dc67e4328f57c37ca9c64806d9d51f9974649114 Mon Sep 17 00:00:00 2001 From: Quicksaver Date: Mon, 28 Sep 2015 11:48:54 +0100 Subject: [PATCH] #106 fillTextFromEditable should respect HTML5 contenteditable --- resource/modules/content/fillSelectedText.jsm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/resource/modules/content/fillSelectedText.jsm b/resource/modules/content/fillSelectedText.jsm index 1897a7e..dd15d26 100644 --- a/resource/modules/content/fillSelectedText.jsm +++ b/resource/modules/content/fillSelectedText.jsm @@ -1,4 +1,4 @@ -Modules.VERSION = '2.0.5'; +Modules.VERSION = '2.0.6'; this.selectedText = { handleEvent: function(e) { @@ -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; } } }