diff --git a/package.json b/package.json index 4e40517..d323aab 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,6 @@ }, "dependencies": { "@babel/runtime": "^7.24.0", - "@extend-chrome/clipboard": "^2.0.0", "qrcode": "^1.5.3", "uuid": "^9.0.0" } diff --git a/src/content/events/contentOnMessage.js b/src/content/events/contentOnMessage.js index 7db3db6..d183fe2 100644 --- a/src/content/events/contentOnMessage.js +++ b/src/content/events/contentOnMessage.js @@ -17,12 +17,10 @@ // along with this program. If not, see // -const browser = require('webextension-polyfill'); const config = require('../../config'); const loadFromLocalStorage = require('../../localStorage/loadFromLocalStorage'); const { notification, inputToken, getTokenInput, showNotificationInfo, loadFonts, isInFrame, pageLoadComplete } = require('../functions'); const storeLog = require('../../partials/storeLog'); -const { clipboard } = require('@extend-chrome/clipboard'); const contentOnMessage = async (request, tabData) => { if (!request || !request.action) { @@ -56,27 +54,14 @@ const contentOnMessage = async (request, tabData) => { if (lastFocusedInput) { tokenInput = getTokenInput(lastFocusedInput); + } + + if (!lastFocusedInput || !tokenInput) { + // Show token in notification + return; // @TODO: remove } else { - return clipboard.writeText(request.token) - .then(() => browser.runtime.sendMessage({ - action: 'notificationOnBackground', - data: config.Texts.Info.CopiedToClipboard, - tabID: tabData?.id - })) - .then(() => { - return { status: 'clipboard' }; - }) - .catch(err => { - console.error(err); - // @TODO: catch err - }); + return inputToken(request, tokenInput, tabData?.url); } - - if (!tokenInput) { - return { status: 'elementNotFound' }; - } - - return inputToken(request, tokenInput, tabData?.url); } case 'pageLoadComplete': { diff --git a/src/content/styles/content_script.scss b/src/content/styles/content_script.scss index 59f75ea..95b54d0 100644 --- a/src/content/styles/content_script.scss +++ b/src/content/styles/content_script.scss @@ -33,6 +33,7 @@ top: 25px !important; user-select: none !important; z-index: 999999 !important; + z-index: infinite !important; @media all and (max-width: 400px) { padding: 10px !important; diff --git a/src/manifest/chrome.json b/src/manifest/chrome.json index 7c4a455..039eda8 100644 --- a/src/manifest/chrome.json +++ b/src/manifest/chrome.json @@ -71,8 +71,7 @@ "tabs", "storage", "notifications", - "contextMenus", - "clipboardWrite" + "contextMenus" ], "host_permissions": [ "*://*.2fas.com/*" diff --git a/src/manifest/edge.json b/src/manifest/edge.json index 7c4a455..039eda8 100644 --- a/src/manifest/edge.json +++ b/src/manifest/edge.json @@ -71,8 +71,7 @@ "tabs", "storage", "notifications", - "contextMenus", - "clipboardWrite" + "contextMenus" ], "host_permissions": [ "*://*.2fas.com/*" diff --git a/src/manifest/firefox.json b/src/manifest/firefox.json index 9cd5996..7184a57 100644 --- a/src/manifest/firefox.json +++ b/src/manifest/firefox.json @@ -77,7 +77,6 @@ "storage", "notifications", "contextMenus", - "clipboardWrite", "https://*.2fas.com/*", "wss://*.2fas.com/*" ], diff --git a/src/manifest/opera.json b/src/manifest/opera.json index 1bcc489..6586ef2 100644 --- a/src/manifest/opera.json +++ b/src/manifest/opera.json @@ -70,8 +70,7 @@ "tabs", "storage", "notifications", - "contextMenus", - "clipboardWrite" + "contextMenus" ], "host_permissions": [ "*://*.2fas.com/*" diff --git a/src/manifest/safari.json b/src/manifest/safari.json index 3a0521e..8719a2f 100644 --- a/src/manifest/safari.json +++ b/src/manifest/safari.json @@ -77,7 +77,6 @@ "storage", "notifications", "contextMenus", - "clipboardWrite", "https://*.2fas.com/*", "wss://*.2fas.com/*" ],