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

98
Visualizações
How to alter address bar URL while I'm in a different website?

Let's say I'm on a https://www.example.com. Can I alter address bar URL to display https://www.google.com while I'm in https://www.example.com website using JavaScript?

ex:

I'm on https://www.example.com website, But what if I wanna display different URL like http://www.google.com in the address bar? Is it possible?

Just asking based on learning purpose about the information security.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

No, that would be a security risk, if any website could make it appear to the user to actually be on any other website. Phishing would be a whole lot easier if that was permitted.

The best you can do is history.pushState (or .replaceState), which has the reasonable restriction that:

The new URL can be any URL in the same origin as the current URL.

Or, of course, you could actually redirect to the other website by assigning to location.href.

It might be possible to write a browser extension that fiddles with the internals of the browser so that it displays your arbitrary desired text instead of the actual current page, but such a thing would have to be deliberately installed by the user.

about 4 years ago · Juan Pablo Isaza Relatório
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