Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: go-back-with-backspace/is_editable.js

Issue 2260633002: Add more input types, fix lowercase nodeName, support shift-backspace (Closed) Base URL: https://chromium.googlesource.com/chromium/extensions-by-google.git@master
Patch Set: Remove trailing CR Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go-back-with-backspace/content_script.js ('k') | go-back-with-backspace/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go-back-with-backspace/is_editable.js
diff --git a/go-back-with-backspace/is_editable.js b/go-back-with-backspace/is_editable.js
index 585aa4fa856968be03aff0afcf704fd936eccf04..d0e4114ebee40f58b60fb4a8a973e24391118a08 100644
--- a/go-back-with-backspace/is_editable.js
+++ b/go-back-with-backspace/is_editable.js
@@ -6,16 +6,24 @@ function isEditable(path) {
if (target.isContentEditable)
return true;
- // Several types of input fields are editable, but not all (e.g., checkboxes).
- var nodeName = target.nodeName;
- var nodeType = target.type;
+ // Many types of input fields are editable, but not all (e.g., checkboxes).
+ var nodeName = target.nodeName.toUpperCase();
+ var nodeType = target.type || '';
+ nodeType = nodeType.toLowerCase();
if (nodeName === 'TEXTAREA' ||
(nodeName === 'INPUT' && (nodeType === 'text' ||
- nodeType === 'email' ||
- nodeType === 'number' ||
nodeType === 'password' ||
nodeType === 'search' ||
- nodeType === 'tel'))) {
+ nodeType === 'date' ||
+ nodeType === 'datetime' ||
+ nodeType === 'datetime-local' ||
+ nodeType === 'email' ||
+ nodeType === 'month' ||
+ nodeType === 'number' ||
+ nodeType === 'tel' ||
+ nodeType === 'time' ||
+ nodeType === 'url' ||
+ nodeType === 'week'))) {
return true;
}
« no previous file with comments | « go-back-with-backspace/content_script.js ('k') | go-back-with-backspace/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698