File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -139,9 +139,22 @@ function init() {
139139const LOAD_TWEAKS = [
140140 // Set role="application" because the most efficient way to
141141 // navigate Google Keep is with keyboard shortcuts and browse mode makes that
142- // harder.
142+ // harder. Also handle certain key presses.
143143 { selector : 'body' ,
144- tweak : el => el . setAttribute ( "role" , "application" ) } ,
144+ tweak : el => {
145+ el . setAttribute ( "role" , "application" ) ;
146+ el . addEventListener ( "keydown" , evt => {
147+ // Make alt+enter open a link if a link bubble is shown.
148+ if ( evt . key == "Enter" && evt . altKey ) {
149+ evt . preventDefault ( ) ;
150+ evt . stopPropagation ( ) ;
151+ const openLink = document . querySelector ( ".IZ65Hb-hSRGPd-V68bde-hSRGPd" ) ;
152+ if ( openLink && openLink . clientWidth > 0 ) {
153+ openLink . click ( ) ;
154+ }
155+ }
156+ } , { capture : true } ) ;
157+ } } ,
145158] ;
146159
147160// Attributes that should be watched for changes and cause dynamic tweaks to be
You can’t perform that action at this time.
0 commit comments