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

Side by Side Diff: go-back-with-backspace/content_script.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 unified diff | Download patch
« no previous file with comments | « no previous file | go-back-with-backspace/is_editable.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Listen for the backspace key and go back if not in an editable field. 1 // Listen for shift-backspace or unmodified backspace and navigate if not in
2 // an editable field.
2 document.addEventListener('keydown', function(e) { 3 document.addEventListener('keydown', function(e) {
3 if (e.which === 8 && // backspace key code 4 if (e.key === 'Backspace' &&
5 !e.altKey &&
6 !e.ctrlKey &&
7 !e.metaKey &&
4 !isEditable(e.path)) { 8 !isEditable(e.path)) {
5 window.history.back(); 9 e.shiftKey ? window.history.forward(): window.history.back();
6 e.preventDefault(); 10 e.preventDefault();
7 } 11 }
8 }); 12 });
OLDNEW
« no previous file with comments | « no previous file | go-back-with-backspace/is_editable.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698