Google Script about redirect not working and appears peculiar error, what happened

Viewed 679

The same code, never modified. However, since September, the javascript

top.location.href='https://....'

and

window.open("https://....", "_top")

all of above are stopped working and the error

"The frame attempting navigation of the top-level window is sandboxed with the 'allow-top-navigation-by-user-activation' flag, but has no user activation (aka gesture)"

occured, what happened??

by the way, why the library of Google App Script being modified recently?? it causes me many harassment....

1 Answers

I've been experiencing the exact same issue since a little while. I think I found a solution although it's not pretty. I now evaluate an html page where I put the redirect url I want to go to in a simple <a> tag. Then I use client side js to click that link like so document.getElementById('yourid').click();

Hope that's an agreeable workaround for you.

Related