jlebon / textern

A Firefox add-on for editing text in your favourite external editor!
GNU General Public License v3.0
141 stars 21 forks source link

textern doesn't support Content-Type application/xhtml+xml; #40

Open wofwofwof opened 6 years ago

wofwofwof commented 6 years ago

When using textern on pages with content type application/xhtml+xml the shortcut doesn't seems to work.

I've tried to debug it. In shortcut.js in line 177 everything is fine. If I step further nothing happens. A breakpoint on the registerText function in content.js is not triggered.

Example page:

Example URL

ledo42 commented 5 years ago

The problem lies in

content.js, line 37 and 55:

if (e.nodeName == "TEXTAREA") {

For any reason e.nodeName can return the node name in lower case. This seams to be related to the mentioned Content-Type. I am not sure if nodeName is to be guaranteed to be in upper case. If so, then this is a bug which should be fixed elsewhere. Meanwhile a workaround could be to change line 37 and 55 to

if (e.nodeName == "TEXTAREA" || e.nodeName == "textarea") {
wofwofwof commented 5 years ago

Thanks a lot, the workaround works fine here.

wofwofwof commented 1 year ago

@jlebon is it possible to add that fix into the code? Its really a hassle to manually add the fix on every update.