Skip to content

Commit

Permalink
#28: clear pressedKeys on window blur
Browse files Browse the repository at this point in the history
  • Loading branch information
neaumusic committed Oct 8, 2020
1 parent 7d0efc4 commit 2def577
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "selection_highlighter",
"version": "1.0.0",
"version": "1.0.1",
"description": "browser highlighter for code analysis",
"scripts": {
"build": "webpack --config webpack.config.js",
Expand Down
2 changes: 1 addition & 1 deletion src/chrome_extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Selection Highlighter",
"version": "2.32",
"version": "2.33",
"description": "Highlight occurrences of selected text, with or without a keypress.",
"options_page": "${OPTIONS_PAGE_PATH}/options_page.html",
"content_scripts": [{
Expand Down
3 changes: 3 additions & 0 deletions src/highlighter/highlighter.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ function initialize () {
pressedKeys.splice(index, 1);
}
});
window.addEventListener('blur', e => {
pressedKeys.splice(0, pressedKeys.length);
});

document.addEventListener('selectionchange', onSelectionChange);

Expand Down

0 comments on commit 2def577

Please sign in to comment.