mirror of
https://github.com/twofas/2fas-browser-extension.git
synced 2024-11-22 02:00:08 +01:00
#1487 MutationObserver - small performance FIX
This commit is contained in:
parent
734f019328
commit
fd3d4be9bb
@ -19,15 +19,17 @@
|
||||
|
||||
const buttonsTexts = require('../../partials/buttonsTexts');
|
||||
const ignoreButtonTexts = require('../../partials/ignoreButtonTexts');
|
||||
const formSubmitSelectors = require('../../partials/formSubmitSelectors');
|
||||
const formSubmitSecondSelectors = require('../../partials/formSubmitSecondSelectors');
|
||||
|
||||
const getFormSubmitElements = () => {
|
||||
let submits = Array.from(
|
||||
document.querySelectorAll(require('../../partials/formSubmitSelectors')())
|
||||
document.querySelectorAll(formSubmitSelectors())
|
||||
);
|
||||
|
||||
if (submits.length <= 0) {
|
||||
submits = Array.from(
|
||||
document.querySelectorAll(require('../../partials/formSubmitSecondSelectors')())
|
||||
document.querySelectorAll(formSubmitSecondSelectors())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -17,12 +17,18 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>
|
||||
//
|
||||
|
||||
const inputsSelectors = require('../../partials/inputsSelectors');
|
||||
let i = 0;
|
||||
|
||||
const getInputs = (node = null) => {
|
||||
const el = node || document;
|
||||
|
||||
return Array.from(
|
||||
el.querySelectorAll(require('../../partials/inputsSelectors')())
|
||||
);
|
||||
console.time(i);
|
||||
const r = Array.from(el.querySelectorAll(inputsSelectors()));
|
||||
console.timeEnd(i);
|
||||
i++;
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
module.exports = getInputs;
|
||||
|
Loading…
Reference in New Issue
Block a user