Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
Tampermonkey JavaScript Global Variable Issue

My issue is that the tempEmail and tempPass are different. Any suggestions to make it static, so the values never change? I have tried using "let" and "var". This has been made with TamperMonkey javascript. Any help would be appreciated. I am not calling it twice? I don't see why they would have different values. (when i print tempEmail and tempPass at different times, they have different valuyes (??)) I have also tried making tempEmail + tempPass const.

// ==UserScript==
// @name         Test
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://*/*
// @grant window.close
// @grant window.focus
// @grant GM_setValue
// ==/UserScript==

const domains = ["@gmail.com", "@hotmail.com", "@outlook.com"];
var username = makeid(getRandomInt(6, 12));
var email = username + domains[Math.floor(Math.random() * domains.length)];
var password = makeid(5);

var tempEmail = email;
var tempPass = password;

function sendMessage() {
        console.log(tempEmail + ":" + tempPass);
    }

function makeid(length) {
        var result = '';
        var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
        var charactersLength = characters.length;
        for (var i = 0; i < length; i++) {
            result += characters.charAt(Math.floor(Math.random() *
                charactersLength));
        }
        return result;
    }

  

(function() {
    'use strict';
    if (/SIGN UP WITH YOUR EMAIL/i.test(document.body.innerHTML)) {
        // My automation code here to sign up on the web site.

    } 
})();
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda