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

217
Visualizações
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 Respostas
Responde à pergunta

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 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