web-browser-input
v0.2.1
Published
Web browser input
Downloads
7
Maintainers
Readme
web-browser-input
Web browser input utilities
Install
npm install web-browser-input --save
Use
belongsToClickableElement(element: Element, options?: object): boolean
— Tells whether a DOMElement
is clickable or is placed inside a clickable DOMElement
. "Clickable" DOMElements
are either<button/>
or<a/>
.options
:stopBefore: Element
— A parent DOMElement
at which the search should stop (not including it).
isKeyCombination(event: Event, keys: string[]): boolean
— Tells whether a keyboardevent
corresponds to a combination of keyboardkeys
. Example:isKeyCombination(event, ['Ctrl', 'Shift', 'Space']) === true/false
.copyTextToClipboard(text: string)
— Copies text to clipboard.openLinkInNewTab(url: string)
— Opens a link in a new tab.readTextFile(file: File): string
— Reads a text file.
Test
npm test
GitHub Ban
On March 9th, 2020, GitHub, Inc. silently banned my account (erasing all my repos, issues and comments) without any notice or explanation. Because of that, all source codes had to be promptly moved to GitLab. The GitHub repo is now only used as a backup (you can star the repo there too), and the primary repo is now the GitLab one. Issues can be reported in any repo.