Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!