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

291
Vistas
Not able to make api request from whatsapp web chat console?
  1. Visit the Whatsapp Web chat (https://web.whatsapp.com/)
  2. Fetch an api call:
(async () => {
const response = await fetch(
  `https://jsonplaceholder.typicode.com/posts/1`
);
const json = await response.json();
console.log(json);
})();
  1. The console returns this error:
VM285:2 Refused to connect to 'https://jsonplaceholder.typicode.com/posts/1'
because it violates the document's Content Security Policy.

PS: Do the same for Telegram Web chat (https://web.telegram.org) and it works

Is it possibile to have a workaround to make it work for the whatsapp page?

Update: You can use this chrome extension to bypass the Content Security Policy

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The Content Security Policy of web.whatsapp.com currently defines connects with the following directive:

connect-src 'self' data: blob: https://*.whatsapp.net https://www.facebook.com https://*.giphy.com https://*.tenor.co https://crashlogs.whatsapp.net/wa_clb_data https://crashlogs.whatsapp.net/wa_fls_upload_check https://www.bingapis.com/api/v6/images/search https://*.google-analytics.com wss://*.web.whatsapp.com wss://web.whatsapp.com https://www.whatsapp.com https://dyn.web.whatsapp.com https://graph.whatsapp.com/graphql;

As jsonplaceholder.typicode.com is not on that allowlist, it is blocked and there is nothing you can do about that.

Telegram is apparently not serving a Content Security Policy header and not restricting such connects.

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