From 3a4af72379b56c83cd566beac7f5a3075b39cfd2 Mon Sep 17 00:00:00 2001 From: hueychen27 <78285518+hueychen27@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:47:56 -0700 Subject: [PATCH 1/4] Add check for if `OPENED_POPUPS[key]` is undefined --- content_scripts/dictionary-plus.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/content_scripts/dictionary-plus.js b/content_scripts/dictionary-plus.js index da33fb0..52ce8da 100644 --- a/content_scripts/dictionary-plus.js +++ b/content_scripts/dictionary-plus.js @@ -543,7 +543,10 @@ function saveWord(key) { function updatePopUp(key, data) { - const popupNode = OPENED_POPUPS[key].node; + const popupNode = OPENED_POPUPS[key]?.node; + + // If user clicks out before definition is retrieved, `OPEN_POPUPS[key]` will not exist + if (popupNode === undefined) return; const popup = popupNode.shadowRoot; @@ -667,4 +670,5 @@ function onStorageChange(changes, area) { SETTINGS = settings.newValue; } -browser.storage.onChanged.addListener(onStorageChange); \ No newline at end of file + +browser.storage.onChanged.addListener(onStorageChange); From 46ee11d9f8199e200e91ce1c592b16a984b80089 Mon Sep 17 00:00:00 2001 From: hueychen27 <78285518+hueychen27@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:54:39 -0700 Subject: [PATCH 2/4] spacing --- content_scripts/dictionary-plus.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content_scripts/dictionary-plus.js b/content_scripts/dictionary-plus.js index 52ce8da..7ea6529 100644 --- a/content_scripts/dictionary-plus.js +++ b/content_scripts/dictionary-plus.js @@ -670,5 +670,6 @@ function onStorageChange(changes, area) { SETTINGS = settings.newValue; } - browser.storage.onChanged.addListener(onStorageChange); + + From e7bbc39a888255d5e41a82db28751243db3e0778 Mon Sep 17 00:00:00 2001 From: hueychen27 <78285518+hueychen27@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:55:12 -0700 Subject: [PATCH 3/4] space --- content_scripts/dictionary-plus.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/content_scripts/dictionary-plus.js b/content_scripts/dictionary-plus.js index 7ea6529..4cabd55 100644 --- a/content_scripts/dictionary-plus.js +++ b/content_scripts/dictionary-plus.js @@ -671,5 +671,3 @@ function onStorageChange(changes, area) { } browser.storage.onChanged.addListener(onStorageChange); - - From 3e173763931f70fe7c01f2e08e143e400b8b8166 Mon Sep 17 00:00:00 2001 From: hueychen27 <78285518+hueychen27@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:56:43 -0700 Subject: [PATCH 4/4] eaceps