Select to view content in your preferred language

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

1072
2
Jump to solution
10-18-2023 04:33 PM
Labels (2)
rdbutger
Emerging Contributor

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. 




1 Solution

Accepted Solutions
AndresCastillo
MVP Alum

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.

 

AndresCastillo_0-1735584736223.png

 

 

 


Thank you @rdbutger !

 

View solution in original post

0 Kudos
2 Replies
AndresCastillo
MVP Alum

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.

0 Kudos
AndresCastillo
MVP Alum

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.

 

AndresCastillo_0-1735584736223.png

 

 

 


Thank you @rdbutger !

 

0 Kudos