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

142
Vistas
replacing the location fuction with custom function

I have seen a proxy website with code similar to this, but there code is obfuscated.

The proxy website changes window.location to window._location

Only 5/7 attempts work below... How do i achieve the other 2?

    var _location = {
        set function(url) {
            window.location = url + "?search=query";
        },
        get href() {
            return window.location.href;
        },
        get protocol() {
            return window.location.protocol;
        },
        get hostname() {
            return window.location.hostname;
        },
        get pathname() {
            return window.location.pathname;
        },
        set href(url) {
            window.location.href = url + "?search=query";
        }
    }

    _location.assign = function(url) {
        window.location.assign(url + "?search=query");
    };

    _location.replace = function(url) {
        window.location.replace(url + "?search=query");
    };

    console.log(window._location.href); // Working
    console.log(_location.href); // Working
    window._location = 'https://stackoverflow.com'; // NOT Working
    window._location.href = 'https://stackoverflow.com'; // Working
    window._location.assign('https://stackoverflow.com'); // Working
    window._location.replace('https://stackoverflow.com'); // Working
    _location = 'https://stackoverflow.com';// NOT Working
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