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

218
Vistas
Error trying opening new window with Google Apps Script

I have a Gmail addon that has stopped working on Google Chrome. But it works fine in Firefox.

The expected behaviour is that, when I press a button, I make an API call and when it responses, a new window should be opened.

This is my code:

if(url) {
  return CardService.newActionResponseBuilder()
    .setOpenLink(
      CardService.newOpenLink().setUrl(url)
    )
    .build();
}

This is the error that appears in the Chrome's console when I press the button:

Refused to run the JavaScript URL because it violates the following Content Security 
Policy directive: "script-src 'nonce-ZdWSj0kAoeg10RRDcE282g' 'self' 
https://apis.google.com https://ssl.gstatic.com https://www.google.com 
https://www.gstatic.com https://www.google-analytics.com". Either the 'unsafe-inline' 
keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline 
execution. Note that hashes do not apply to event handlers, style attributes and 
javascript: navigations unless the 'unsafe-hashes' keyword is present.
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Ok, I fixed this issue replacing setOnClickOpenLinkAction(action) with this setOnClickAction(action)

Now it's working in Chrome and Firefox

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