From 8d9be09baebb9ebf2405eef8bba763d1d4d08bec Mon Sep 17 00:00:00 2001 From: Brendan Early Date: Tue, 25 Jun 2024 19:41:53 -0500 Subject: [PATCH 1/2] Fix #1203 --- src/components/Popup/EntryComponent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Popup/EntryComponent.vue b/src/components/Popup/EntryComponent.vue index e1cfd8fb1..4a6f51cc2 100644 --- a/src/components/Popup/EntryComponent.vue +++ b/src/components/Popup/EntryComponent.vue @@ -297,7 +297,7 @@ function getQrUrl(entry: OTPEntry) { async function insertContentScript() { const tab = await getCurrentTab(); - if (tab.id) { + if (tab.id && !tab.url?.startsWith("chrome:")) { await chrome.scripting.executeScript({ target: { tabId: tab.id }, files: ["/dist/content.js"], From 44748fff3a88fd001958464e5f56877b09b48982 Mon Sep 17 00:00:00 2001 From: Brendan Early Date: Tue, 25 Jun 2024 21:23:51 -0500 Subject: [PATCH 2/2] copy even if autofill fails --- src/components/Popup/EntryComponent.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/Popup/EntryComponent.vue b/src/components/Popup/EntryComponent.vue index 4a6f51cc2..572d719ad 100644 --- a/src/components/Popup/EntryComponent.vue +++ b/src/components/Popup/EntryComponent.vue @@ -223,13 +223,12 @@ export default Vue.extend({ if (this.$store.state.menu.useAutofill) { await insertContentScript(); const tab = await getCurrentTab(); - if (!tab || !tab.id) { - return; + if (tab && tab.id) { + chrome.tabs.sendMessage(tab.id, { + action: "pastecode", + code: entry.code, + }); } - chrome.tabs.sendMessage(tab.id, { - action: "pastecode", - code: entry.code, - }); } const lastActiveElement = document.activeElement as HTMLElement;