docwhat / itsalltext

It's All Text! - Edit textareas in your browser with your favorite editor!
GNU General Public License v3.0
197 stars 31 forks source link

Support divs with contenteditable=true #72

Open davidshepherd7 opened 9 years ago

davidshepherd7 commented 9 years ago

Google inbox uses a div with contenteditable="true" instead of a textarea for email composition (which seems like a stupid idea to me...). It would be great if itsalltext could support editing this.

I might have a go at implementing this myself, do you think it's possible? Any pointers?

xOneca commented 9 years ago

I don't think it would be hard to implement this. See discussion in #36.

But keep in mind that contenteditable elements usually contain HTML code, so what you will edit with the external editor will be pure HTML.

davidshepherd7 commented 9 years ago

I had a quick attempt, I got it sort of working by just adding

(tag == 'div' && node.getAttribute('contenteditable') == "true")

to the expression for is_disabled in onContextMenu. However it seemed be flaky: sometimes the button wouldn't appear and sometimes the context menu wouldn't appear. It wasn't obvious to me why this was happening, but then I don't really know what I'm doing with Firefox extensions.

But the main problem is the html, as you said. I don't think that's going to be a convenient way to write emails. Probably the best fix at this point is to pester google to add an option to use plain text (there's one for gmail, so hopefully they'll do it eventually).

docwhat commented 7 years ago

I'm not sure if I should close this or not. It's really not a problem that can be addressed generically.