Skip to content

Commit

Permalink
Merge pull request #23 from AdeelH/ctrl-click-fix
Browse files Browse the repository at this point in the history
Extend fix in #21 to cmd, shift, and alt keys
  • Loading branch information
AdeelH committed Jan 26, 2021
2 parents 7096fd0 + 61b84e2 commit 3734527
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

## v1.5.1:
- Fix bug in ctrl+click behavior.
## v1.5.2:
- Fix bug in ctrl/cmd/shift/alt+click behavior.
- Minor improvements to the options page.

## v1.5.0:
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"name": "Find on Reddit",
"description": "Find discussions of the current URL on Reddit",
"version": "1.5.1",
"version": "1.5.2",

"browser_action": {
"default_icon": "icon-256.png",
Expand Down
5 changes: 3 additions & 2 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ function registerHandlers(opts) {
// open links in new tab - or not
$('body').on('click', 'a', function(e) {
let clickedUrl = $(this).attr('href');
if (e.ctrlKey) {
/* ctrl + click: do not modify default browser behavior */
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) {
/* ctrl/cmd/shift/alt + click:
do not modify default browser behavior */
}
else if (opts.newtab) {
chrome.tabs.create({
Expand Down

0 comments on commit 3734527

Please sign in to comment.