ArcGIS Online popup appending rel="noopener noreferrer", even when you don't want it to!

430
0
10-18-2023 04:33 PM
Labels (2)
rdbutger
New Contributor II

We have a web app for which we've set security with http referrer -- we only want that app to open when opened from links on certain web apps/pages. 

Next, I wanted to build a web map in our ArcGIS Enterprise, click on features in that web map, and open a URL within our web app, including passing parameters obtained from the features. Since we added our ArcGIS Enterprise portal to our list of approved referrer domains, no problem, right? 

Wrong. 

When using a popup and adding Text content to form a link like this -- 

https://myserver.com/myapp?id={featureid} 

That's not what actually gets populated with the link. In the text editor, click Source, and this is what gets created there -- 

<a target="_blank" rel="noopener noreferrer" href="https://myserver.com/myapp?id={FeatureID} ">Open My App</a>

If you remove rel="noopener noreferrer", guess what? It come back. The ArcGIS Popup editor appends that back to your link regardless of what you do. And of course, passing "noreferrer" removes the referrer, and now the link to your app won't open. 

Workaround - create the link with Arcade -- 

type : 'text',
text : '<a href="https:'+TextFormatting.ForwardSlash + TextFormatting.ForwardSlash+'myserver.com/myapp?id= '+$feature.FeatureID+'">Open My App</a>'

Fortunately, with the Arcade expression, ArcGIS does not append anything to your link, and you can open your app as you want. 




0 Kudos
0 Replies