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.
Solved! Go to Solution.
it works for me like this:
var baseurl = 'https://www.something.com/route/'
var code = Lower($feature.ColumnName)
var train_stations_public_page = Concatenate([baseurl,code])
Console(train_stations_public_page)
var train_stations_public_page_link = '<strong><a style="color:#01507b;text-decoration: underline;cursor:pointer" target="_self" href="' + train_stations_public_page + '">Station Details</a></strong>'
Console(train_stations_public_page_link)
return {
type : 'text',
text : train_stations_public_page_link
}
This way, I can change the page in-place, instead of opening a new tab.
Thank you @rdbutger !
I noticed this issue also.
Seems the web map wants to prevent this referrer for security reasons.
In my case, I wanted to try target="_self" to see if I can change the page view.
it works for me like this:
var baseurl = 'https://www.something.com/route/'
var code = Lower($feature.ColumnName)
var train_stations_public_page = Concatenate([baseurl,code])
Console(train_stations_public_page)
var train_stations_public_page_link = '<strong><a style="color:#01507b;text-decoration: underline;cursor:pointer" target="_self" href="' + train_stations_public_page + '">Station Details</a></strong>'
Console(train_stations_public_page_link)
return {
type : 'text',
text : train_stations_public_page_link
}
This way, I can change the page in-place, instead of opening a new tab.
Thank you @rdbutger !