Skip to content

Commit

Permalink
🚸 prevent save event
Browse files Browse the repository at this point in the history
  • Loading branch information
yize committed Jan 18, 2018
1 parent a940c0a commit f4435b4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,17 @@ chrome.storage.sync.get('config_for_shown', (result) => {
});
});
});

function preventSave() {
document.addEventListener(
'keydown',
(e) => {
if (e.keyCode === 83 && (navigator.platform.match('Mac') ? e.metaKey : e.ctrlKey)) {
e.preventDefault();
}
},
false,
);
}

preventSave();

0 comments on commit f4435b4

Please sign in to comment.