I have created an anchor in a WebApp that will link to a page in the same Google Site when clicked;
however when clicked it always shows the redirect warning.
I looked around on this question and found that they said the issue has been fixed but If it is fixed, why am I still seeing the warning?
Do I need to create the anchor in a specific way?
This is my code:
var pageurl = "https://sites.google.com/site/.../dir1/dir2/";
var title = app.createAnchor(productDetails[i].itemname, pageurl +
productDetails[i].id).setTarget("_self");
This is not a bug; it's known intentional behavior for anonymous users of anonymous scripts. The bug was that this was happening for signed in users sometimes.
The reason for this is because we redirect through an interstitial that has the effect of stripping the referrer out so that we don't leak your script id into the logs of wherever your anchor points to. This is a security mechanism, since your script id is potentially sensitive information, and the way we construct the redirect requires a logged in user. If you aren't logged in, the intermediate page is the best we can do using that technique.
In HtmlService we solved the same problem with a different technique that doesn't require the interstitial even for anonymous users, so if you can use HtmlService instead of UiApp this problem won't arise. Unfortunately I don't think we will be changing UiApp to use the newer technique anytime soon.