diff --git a/src/content/events/contentOnMessage.js b/src/content/events/contentOnMessage.js index d183fe2..2d16277 100644 --- a/src/content/events/contentOnMessage.js +++ b/src/content/events/contentOnMessage.js @@ -57,15 +57,17 @@ const contentOnMessage = async (request, tabData) => { } if (!lastFocusedInput || !tokenInput) { - // Show token in notification - return; // @TODO: remove + return notification({ + title: 'Your token', + message: request.token + }); // @TODO: change to proper notification later } else { return inputToken(request, tokenInput, tabData?.url); } } case 'pageLoadComplete': { - return pageLoadComplete(tabData?.id); + return { status: 'ok' } // Possibly for future use } case 'notification': @@ -75,7 +77,7 @@ const contentOnMessage = async (request, tabData) => { if (request.action === 'notification') { return notification(request); } else if (request.action === 'notificationInfo') { - return showNotificationInfo(request); + return showNotificationInfo(); } break; diff --git a/src/content/functions/index.js b/src/content/functions/index.js index 9280f77..f899369 100644 --- a/src/content/functions/index.js +++ b/src/content/functions/index.js @@ -35,7 +35,6 @@ exports.loadFonts = require('./loadFonts'); exports.neverShowNotificationInfo = require('./neverShowNotificationInfo'); exports.notification = require('./notification'); exports.openOptionsPage = require('./openOptionsPage'); -exports.pageLoadComplete = require('./pageLoadComplete'); exports.portSetup = require('./portSetup'); exports.showNotificationInfo = require('./showNotificationInfo'); exports.updateEventListener = require('./updateEventListener'); diff --git a/src/content/functions/pageLoadComplete.js b/src/content/functions/pageLoadComplete.js deleted file mode 100644 index bc0fe18..0000000 --- a/src/content/functions/pageLoadComplete.js +++ /dev/null @@ -1,30 +0,0 @@ -// -// This file is part of the 2FAS Browser Extension (https://github.com/twofas/2fas-browser-extension) -// Copyright © 2023 Two Factor Authentication Service, Inc. -// Contributed by Grzegorz Zając. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see -// - -const addInputListener = require('../functions/addInputListener'); -const getInputs = require('../functions/getInputs'); -const addFormElementsNumber = require('../functions/addFormElementsNumber'); -const getFormElements = require('../functions/getFormElements'); - -const pageLoadComplete = async tabID => { - addInputListener(getInputs(), tabID); - addFormElementsNumber(getFormElements()); -}; - -module.exports = pageLoadComplete;