From 1f4aeeb0c31ce2b0a18fbc7bc5ac5fc3c745dfb2 Mon Sep 17 00:00:00 2001 From: Matthew Sherrill Date: Tue, 4 Oct 2022 15:16:10 -0600 Subject: [PATCH] fix capital letter in activation phrase - ms --- CHANGELOG.md | 4 ++++ package.json | 2 +- public/manifest.chrome.json | 33 ++++++++++++++++++++++++--------- public/manifest.firefox.json | 24 +++++++++++++++++------- src/ts/options.ts | 4 ++-- src/ts/voiceDim.ts | 2 +- 6 files changed, 49 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7637324..3152899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 1.2.2 - 2022-10-04 - Activation Phrase Fix + +- Added fix for capital letter in activation phrase by trimming/lowercasing everywhere + ### 1.2.1 - 2022-10-03 - Only in Inventory - Added fix for loading DIM on another tab. Previously required reloading the page on the inventory tab. Now Voice DIM will load no matter what page is started on diff --git a/package.json b/package.json index 4aaa6a8..f7f8666 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "voice-dim", - "version": "1.2.1", + "version": "1.2.2", "description": "Perform common DIM actions by using speech recognition.", "main": "dist/chrome/js/voice-dim.js", "scripts": { diff --git a/public/manifest.chrome.json b/public/manifest.chrome.json index 059316b..6649d40 100644 --- a/public/manifest.chrome.json +++ b/public/manifest.chrome.json @@ -1,16 +1,22 @@ { "name": "Voice DIM", "description": "Control DIM with your voice.", - "version": "1.2.1", + "version": "1.2.2", "manifest_version": 3, "background": { "service_worker": "js/background.js" }, "content_scripts": [ { - "matches": ["https://*.destinyitemmanager.com/*"], - "js": ["js/voiceDim.js"], - "css": ["css/voiceDim.css"] + "matches": [ + "https://*.destinyitemmanager.com/*" + ], + "js": [ + "js/voiceDim.js" + ], + "css": [ + "css/voiceDim.css" + ] } ], "commands": { @@ -36,12 +42,21 @@ "page": "html/options.html", "open_in_tab": true }, - "host_permissions": ["https://www.bungie.net/*"], - "permissions": ["tabs", "storage"], + "host_permissions": [ + "https://www.bungie.net/*" + ], + "permissions": [ + "tabs", + "storage" + ], "web_accessible_resources": [ { - "resources": ["icons/icon_large.png"], - "matches": ["https://*.destinyitemmanager.com/*"] + "resources": [ + "icons/icon_large.png" + ], + "matches": [ + "https://*.destinyitemmanager.com/*" + ] } ] -} +} \ No newline at end of file diff --git a/public/manifest.firefox.json b/public/manifest.firefox.json index 79fe09c..78c1d57 100644 --- a/public/manifest.firefox.json +++ b/public/manifest.firefox.json @@ -1,16 +1,24 @@ { "name": "Voice DIM", "description": "Control DIM with your voice.", - "version": "1.2.1", + "version": "1.2.2", "manifest_version": 2, "background": { - "scripts": ["js/background.js"] + "scripts": [ + "js/background.js" + ] }, "content_scripts": [ { - "matches": ["https://*.destinyitemmanager.com/*"], - "js": ["js/voiceDim.js"], - "css": ["css/voiceDim.css"] + "matches": [ + "https://*.destinyitemmanager.com/*" + ], + "js": [ + "js/voiceDim.js" + ], + "css": [ + "css/voiceDim.css" + ] } ], "commands": { @@ -42,5 +50,7 @@ "https://www.bungie.net/common/**", "https://api.speechly.com/**" ], - "web_accessible_resources": ["icons/icon_large.png"] -} + "web_accessible_resources": [ + "icons/icon_large.png" + ] +} \ No newline at end of file diff --git a/src/ts/options.ts b/src/ts/options.ts index 06a5936..5bdd22d 100644 --- a/src/ts/options.ts +++ b/src/ts/options.ts @@ -48,7 +48,7 @@ function onActivationPhraseChange() { store('alwaysListening', { active: listeningToggle.checked, - activationPhrase: activationPhrase.value, + activationPhrase: activationPhrase.value.trim().toLowerCase(), }); sendListenOptionsMessage(); } @@ -61,7 +61,7 @@ function onAlwaysListeningChange(listeningOptions: AlwaysListening) { store('alwaysListening', { active: listeningOptions.active, - activationPhrase: listeningOptions.activationPhrase, + activationPhrase: listeningOptions.activationPhrase.trim().toLowerCase(), }); sendListenOptionsMessage(); } diff --git a/src/ts/voiceDim.ts b/src/ts/voiceDim.ts index e253529..2417df5 100644 --- a/src/ts/voiceDim.ts +++ b/src/ts/voiceDim.ts @@ -519,7 +519,7 @@ function initializeAlwaysListening() { let actionPerformed = false; for (let said of userSaid) { said = said.trim().toLowerCase(); - const ap = listeningOptions.activationPhrase; + const ap = listeningOptions.activationPhrase.trim().toLowerCase(); const phrases = [ap]; if (ap.includes('dim')) phrases.push(ap.replace('dim', 'them'));