Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

204
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda