Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 771 Bytes

JavaScript.md

File metadata and controls

10 lines (7 loc) · 771 Bytes

JavaScript

Userscripts

monitor_focus.user.js - A quick and dirty focus tracker, logs the currently focused element to console

Libraries and code snippets

shortcuts.js - A small and easy-to-use library which can be used to implement keyboard shortcuts.

Nuggets and Advice

  • Dispatching a MouseEvent or .click() not working for an element? - Try to make the event bubble so event listeners in ancestral nodes can catch the event and do something. Example to create a bubbling event: new MouseEvent('mousedown', {bubbles: true})