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

1K
Vistas
why net::ERR_UNSAFE_REDIRECT in chrome when redirecting to 'data:' links?

I developing new extension for google chrome browser, and now I stacked this task:

  1. Use chrome.webRequest.onBeforeRequest to intercept the request.
  2. Prevent the request from executing (but not completing its error) by redirecting to a link like data:text/javascript;charset=utf-8, (empty js).

developer chrome docs says, that I can do it like this:

chrome.webRequest.onBeforeRequest.addListener((details)=>{
    //some if statments and etc...

    return { redirectUrl: 'data:text/javascript;charset=utf-8,'}

}, {urls: ["<all_urls>"]}, ["blocking"]);

And I am very sure it's allowed to redirect to data: links like this, because of this docs:

redirectUrl Only used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as data: are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method. Redirects from URLs with ws:// and wss:// schemes are ignored.

from this documentations

But when I tries to do this, I see this error in console: net:ERR_UNSAFE_REDIRECT

So, what is my problem?

P.S. in my mainfest.json I have this permisions:

"permissions": [ "webNavigation", "tabs", "webRequest", "webRequestBlocking", "<all_urls>", "notifications", "storage", "contextMenus", "unlimitedStorage" ],
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