From 87e1885fe66375598d1544df3d00a0b6a93f92c1 Mon Sep 17 00:00:00 2001 From: marcolussetti Date: Wed, 13 Oct 2021 20:27:25 -0700 Subject: [PATCH] Switch to CTRL-H --- manifest.json | 4 ++-- optindetector.js | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 43bf1af..2150f46 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 2, "name": "Hacktoberfest Opt-in Checker", - "version": "1.0", - "description": "Detect whether the repository has opted into the 2020 Hacktoberfest.", + "version": "1.1.0", + "description": "Detect whether the repository has opted into the 2021 Hacktoberfest.", "icons": { "96": "icons/icon-96.png", "48": "icons/icon-48.png" diff --git a/optindetector.js b/optindetector.js index 920fabb..be3cc1c 100644 --- a/optindetector.js +++ b/optindetector.js @@ -56,10 +56,14 @@ function isGithubProject() { if (isGithubProject()) { console.log("[Hacktoberfest Tag Detector] GitHub Project detected"); document.addEventListener("keyup", function (e) { - var key = e.key || e.keyCode; - if (key === 'h' || key === 'KeyH' || key === 72) { + var eObj = window.event ? event : e + // var key = eObj.key || eObj.keyCode; + if (e.ctrlKey && e.key === 'h') { checkIfEnrolled() } + //if (key === 'h' || key === 'KeyH' || key === 72) { + // checkIfEnrolled() + //} }); } else { console.log("[Hacktoberfest Tag Detector] GitHub Project not detected");