Merge pull request #90 from twofas/develop

v1.7.2
This commit is contained in:
Greg Zajac 2024-07-15 17:23:43 +02:00 committed by GitHub
commit 002bd30853
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 215 additions and 74 deletions

View File

@ -3,4 +3,4 @@ API_URL=https://api2.2fas.com
# Websocket URL (default: wss://ws.2fas.com)
WS_URL=wss://ws.2fas.com
# [ONLY FOR 2FAS TEAM] Key for localise.biz
LOCO_KEY=
LOCO_KEY=EMPTY

View File

@ -431,7 +431,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 60;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = ZY8UR5ADFW;
ENABLE_HARDENED_RUNTIME = YES;
@ -445,7 +445,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.7.1;
MARKETING_VERSION = 1.7.2;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
@ -467,7 +467,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 60;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = ZY8UR5ADFW;
ENABLE_HARDENED_RUNTIME = YES;
@ -481,7 +481,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.7.1;
MARKETING_VERSION = 1.7.2;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
@ -505,7 +505,7 @@
CODE_SIGN_ENTITLEMENTS = "macOS (App)/2FAS - Two factor authentication.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 60;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = ZY8UR5ADFW;
ENABLE_HARDENED_RUNTIME = YES;
@ -519,7 +519,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.7.1;
MARKETING_VERSION = 1.7.2;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
@ -545,7 +545,7 @@
CODE_SIGN_IDENTITY = "Apple Distribution";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 60;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = ZY8UR5ADFW;
ENABLE_HARDENED_RUNTIME = YES;
@ -559,7 +559,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.7.1;
MARKETING_VERSION = 1.7.2;
OTHER_LDFLAGS = (
"-framework",
SafariServices,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "2fas-browser-extension",
"version": "1.7.1",
"version": "1.7.2",
"description": "This is the official Browser Extension for the Open Source 2FAS project.",
"engines": {
"node": "20.11.1"
@ -51,32 +51,32 @@
"url": "https://2fas.com/donate/"
},
"devDependencies": {
"@babel/core": "^7.24.5",
"@babel/eslint-parser": "^7.24.5",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.5",
"@babel/register": "^7.23.7",
"@babel/core": "^7.24.7",
"@babel/eslint-parser": "^7.24.7",
"@babel/plugin-transform-runtime": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/register": "^7.24.6",
"autoprefixer": "^10.4.19",
"babel-loader": "^9.1.3",
"babel-plugin-transform-minify-booleans": "^6.9.4",
"babel-plugin-transform-remove-debugger": "^6.9.4",
"babel-preset-minify": "^0.5.2",
"browserslist": "^4.23.0",
"browserslist": "^4.23.1",
"copy-webpack-plugin": "^12.0.2",
"cross-env": "^7.0.3",
"crypto-browserify": "^3.12.0",
"css-loader": "^7.1.1",
"css-minimizer-webpack-plugin": "^6.0.0",
"css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "^7.0.0",
"dotenv": "^16.4.5",
"dotenv-webpack": "^8.1.0",
"eslint": "8.57.0",
"eslint": "9.5.0",
"eslint-config-standard": "^17.1.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-n": "^17.9.0",
"eslint-plugin-promise": "^6.2.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-webpack-plugin": "^4.1.0",
"eslint-webpack-plugin": "^4.2.0",
"exports-loader": "^5.0.0",
"file-loader": "^6.0.0",
"html-loader": "^5.0.0",
@ -90,28 +90,28 @@
"precss": "^4.0.0",
"require-dir": "^1.2.0",
"rimraf": "^5.0.5",
"sass": "^1.76.0",
"sass": "^1.77.6",
"sass-loader": "^14.2.1",
"source-map-loader": "^5.0.0",
"stream-browserify": "^3.0.0",
"streamify": "^1.0.0",
"style-loader": "^4.0.0",
"stylelint": "^16.5.0",
"stylelint": "^16.6.1",
"stylelint-config-recommended-scss": "^14.0.0",
"stylelint-webpack-plugin": "^5.0.0",
"stylelint-webpack-plugin": "^5.0.1",
"svg-inline-loader": "^0.8.2",
"terser-webpack-plugin": "^5.3.10",
"url-loader": "^4.1.0",
"webextension-polyfill": "^0.11.0",
"webpack": "^5.91.0",
"webextension-polyfill": "^0.12.0",
"webpack": "^5.92.1",
"webpack-cli": "^5.1.4",
"webpack-node-externals": "^3.0.0",
"ws": "^8.17.0",
"ws": "^8.17.1",
"yarn-or-npm": "^3.0.1"
},
"dependencies": {
"@babel/runtime": "^7.24.5",
"@babel/runtime": "^7.24.7",
"qrcode": "^1.5.3",
"uuid": "^9.0.1"
"uuid": "^10.0.0"
}
}

View File

@ -23,7 +23,7 @@ const t = require('./_locales/en/notifications.json');
const config = {
WebSocketTimeout: 3, // in minutes
ResendPushTimeout: 10, // in seconds
ExtensionVersion: '1.7.1',
ExtensionVersion: '1.7.2',
Texts: {
Error: {

View File

@ -17,8 +17,8 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>
//
/* global Event, KeyboardEvent */
const delay = require('../../partials/delay');
/* global Event, KeyboardEvent, InputEvent */
const runTasksWithDelay = require('../../partials/runTasksWithDelay');
const getTabData = require('./getTabData');
const clickSubmit = require('./clickSubmit');
const clearAfterInputToken = require('./clearAfterInputToken');
@ -34,48 +34,38 @@ const inputToken = (request, inputElement, siteURL) => {
}
const tokenLength = request.token.length;
let clearEvent = new Event('change', { bubbles: true, cancelable: true });
let inputEvent = new Event('input', { bubbles: true, cancelable: true });
const promises = [];
inputElement.value = '';
inputElement.focus();
for (let i = 0; i < tokenLength; i++) {
promises.push(
delay(() => {
// MANY INPUTS FIX
if (i === 0) {
inputElement.focus();
inputElement.value = '';
inputElement.dispatchEvent(clearEvent);
inputElement.focus();
() => new Promise(resolve => {
if (document.activeElement !== inputElement) {
document.activeElement.value = '';
}
if (!inputElement.contains(document.activeElement)) {
if (!siteURL.includes('secure.newegg')) { // NEWEGG FIX
document.activeElement.focus();
document.activeElement.value = '';
document.activeElement.dispatchEvent(clearEvent);
document.activeElement.focus();
}
}
// END MANY INPUTS FIX
document.activeElement.dispatchEvent(new KeyboardEvent('keydown', { bubbles: true, cancelable: true, charCode: 0, code: `Digit${request.token[i]}`, ctrlKey: false, key: request.token[i], keyCode: 48 + parseInt(request.token[i], 10), location: 0, metaKey: false, repeat: false, shiftKey: false, which: 48 + parseInt(request.token[i], 10) }));
document.activeElement.dispatchEvent(new KeyboardEvent('keypress', { bubbles: true, cancelable: true, charCode: 48 + parseInt(request.token[i], 10), code: `Digit${request.token[i]}`, ctrlKey: false, key: request.token[i], keyCode: 48 + parseInt(request.token[i], 10), location: 0, metaKey: false, repeat: false, shiftKey: false, which: 48 + parseInt(request.token[i], 10) }));
document.activeElement.value += request.token[i];
document.activeElement.dispatchEvent(inputEvent);
// NORTON FIX
if (siteURL.includes('login.norton') || siteURL.includes('indodax.com')) {
document.activeElement.dispatchEvent(new KeyboardEvent('keyup', { key: request.token[i] }));
if (document.activeElement.type.toLowerCase() === 'number') {
document.activeElement.value += parseInt(request.token[i], 10);
} else {
document.activeElement.value += request.token[i];
}
// END NORTON FIX
}, 100 * i)
document.activeElement.dispatchEvent(new InputEvent('input', { bubbles: true, cancelable: true, data: request.token[i], inputType: 'insertText', which: 0 }));
document.activeElement.dispatchEvent(new KeyboardEvent('keyup', { bubbles: true, cancelable: true, charCode: 0, code: `Digit${request.token[i]}`, ctrlKey: false, key: request.token[i], keyCode: 48 + parseInt(request.token[i], 10), location: 0, metaKey: false, repeat: false, shiftKey: false, which: 48 + parseInt(request.token[i], 10) }));
document.activeElement.dispatchEvent(new Event('change', { bubbles: true, cancelable: true }));
return resolve();
})
);
}
return Promise.all(promises)
return runTasksWithDelay(promises, 150)
.then(async () => {
clearEvent = null;
inputEvent = null;
const tab = await getTabData();
if (tab.status === 'complete') {

View File

@ -3,7 +3,7 @@
"name": "2FAS - Two Factor Authentication",
"short_name": "2FAS",
"author": "Two Factor Authentication Service, Inc.",
"version": "1.7.1",
"version": "1.7.2",
"description": "__MSG_appDesc__",
"default_locale": "en",
"icons": {

View File

@ -3,7 +3,7 @@
"name": "2FAS - Two Factor Authentication",
"short_name": "2FAS",
"author": "Two Factor Authentication Service, Inc.",
"version": "1.7.1",
"version": "1.7.2",
"description": "__MSG_appDesc__",
"default_locale": "en",
"icons": {

View File

@ -3,11 +3,11 @@
"name": "2FAS - Two Factor Authentication",
"short_name": "2FAS",
"author": "Two Factor Authentication Service, Inc.",
"version": "1.7.1",
"version": "1.7.2",
"applications": {
"gecko": {
"id": "admin@2fas.com",
"strict_min_version": "57.0"
"strict_min_version": "58.0"
}
},
"description": "__MSG_appDesc__",

View File

@ -3,7 +3,7 @@
"name": "2FAS - Two Factor Authentication",
"short_name": "2FAS",
"author": "Two Factor Authentication Service, Inc.",
"version": "1.7.1",
"version": "1.7.2",
"description": "__MSG_appDesc__",
"default_locale": "en",
"icons": {

View File

@ -3,7 +3,7 @@
"name": "2FAS - Two Factor Authentication",
"short_name": "2FAS",
"author": "Two Factor Authentication Service, Inc.",
"version": "1.7.1",
"version": "1.7.2",
"description": "__MSG_appDesc__",
"default_locale": "en",
"icons": {

View File

@ -32,7 +32,9 @@ exports.inputsSelectors = require('./inputsSelectors');
exports.months = require('./months');
exports.onTabFocused = require('./onTabFocused');
exports.openShortcutEdit = require('./openShortcutEdit');
exports.runTasksWithDelay = require('./runTasksWithDelay');
exports.sendMessageToTab = require('./sendMessageToTab');
exports.storageValidation = require('./storageValidation');
exports.storeLog = require('./storeLog');
exports.uniqueOnly = require('./uniqueOnly');
exports.wait = require('./wait');

View 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 wait = require('./wait');
const runTasksWithDelay = async (tasks, delayTime) => {
for (const task of tasks) {
await task();
await wait(delayTime);
}
};
module.exports = runTasksWithDelay;

24
src/partials/wait.js Normal file
View File

@ -0,0 +1,24 @@
//
// 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 wait = async ms => {
return new Promise(resolve => setTimeout(resolve, ms));
};
module.exports = wait;

View File

@ -81,8 +81,6 @@ Promise.all(Object.keys(urls).map(locale => {
});
})
.then(() => {
// console.log(files);
return Object.keys(files).forEach(locale => {
return Object.keys(files[locale]).forEach(fileName => {
const data = JSON.stringify(files[locale][fileName], null, 2);
@ -90,7 +88,3 @@ Promise.all(Object.keys(urls).map(locale => {
});
});
});
// Przelecieć po wszystkich locale'ach i po wszystkich kluczach i dopisać do files
// Zapisać do jsonów
// Test z wieloma językami