mirror of
https://github.com/twofas/2fas-browser-extension.git
synced 2024-11-22 18:19:59 +01:00
#1254 dummyGetLocalStorage - interval 25s + checkTabCS
This commit is contained in:
parent
bf3041195b
commit
80d2b60457
@ -18,7 +18,7 @@
|
||||
//
|
||||
|
||||
const browser = require('webextension-polyfill');
|
||||
const { onConnect, onCommand, onContextMenuClick, onInstalled, getBrowserInfo, onMessage, onStartup, browserAction, createContextMenus } = require('./functions');
|
||||
const { onConnect, onCommand, onContextMenuClick, onInstalled, getBrowserInfo, onMessage, onStartup, browserAction, createContextMenus, dummyGetLocalStorage } = require('./functions');
|
||||
const { onTabRemoved, onTabUpdated, onTabActivated } = require('./tabs');
|
||||
|
||||
const browserInfo = getBrowserInfo();
|
||||
@ -43,3 +43,7 @@ browser.contextMenus.onClicked.addListener(onContextMenuClick);
|
||||
browser.tabs.onRemoved.addListener(onTabRemoved);
|
||||
browser.tabs.onUpdated.addListener(onTabUpdated);
|
||||
browser.tabs.onActivated.addListener(onTabActivated);
|
||||
|
||||
setInterval(() => {
|
||||
return dummyGetLocalStorage();
|
||||
}, 25 * 1000);
|
||||
|
@ -19,9 +19,11 @@
|
||||
|
||||
const browser = require('webextension-polyfill');
|
||||
const setIcon = require('./setIcon');
|
||||
const dummyGetLocalStorage = require('./dummyGetLocalStorage');
|
||||
|
||||
const checkTabCS = async tabId => {
|
||||
await new Promise(resolve => setTimeout(resolve, 50));
|
||||
await dummyGetLocalStorage();
|
||||
|
||||
if (!tabId) {
|
||||
return;
|
||||
|
29
src/background/functions/dummyGetLocalStorage.js
Normal file
29
src/background/functions/dummyGetLocalStorage.js
Normal file
@ -0,0 +1,29 @@
|
||||
//
|
||||
// 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 <https://www.gnu.org/licenses/>
|
||||
//
|
||||
|
||||
const loadFromLocalStorage = require('../../localStorage/loadFromLocalStorage');
|
||||
|
||||
const dummyGetLocalStorage = () => {
|
||||
return loadFromLocalStorage('extensionID')
|
||||
.then(storage => {
|
||||
storage = null;
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = dummyGetLocalStorage;
|
@ -28,6 +28,7 @@ exports.closeRequest = require('./closeRequest');
|
||||
exports.closeWSChannel = require('./closeWSChannel');
|
||||
exports.createContextMenus = require('./createContextMenus');
|
||||
exports.Crypt = require('./Crypt');
|
||||
exports.dummyGetLocalStorage = require('./dummyGetLocalStorage');
|
||||
exports.generateDefaultStorage = require('./generateDefaultStorage');
|
||||
exports.getBrowserInfo = require('./getBrowserInfo');
|
||||
exports.getOSName = require('./getOSName');
|
||||
|
Loading…
Reference in New Issue
Block a user