Select to view content in your preferred language

Iframe in context menu

395
1
02-01-2024 06:22 AM
Labels (1)
N0MAD
by
New Contributor III

Hello everyone

I'm currently working on a project with MapViewer i saw that Arcade can display HTML but i wonder why does frame, iframe and script tags are always deleted

var body = `<p style='font-family: Arial; text-align: center'>test</p><script>alert('test');</script>`

return { type: 'text', text: body }

Like for instance, this code should trigger the browser "alert" function but, here's what MapViewer display:

<div>
   <p style="font-family:Arial; text-align:center;">test</p>
</div>

 

And it do the same for iframe, frame, etc...
Is there any way to force MapViewer to handle script or iframes ?
It would allow to do so much more than just Arcade himself

0 Kudos
1 Reply
N0MAD
by
New Contributor III

Looking in the Esri developer doc, I found this page: https://doc.arcgis.com/en/arcgis-online/reference/supported-html.htm

Basically, they explain that few tags are available, so tags like 'style', 'script', and others are simply removed from the page.

That's pretty sad when you consider how useful scripts and styles would be.

Like defining a style for all contextual menus, or allowing more complex manipulation of contextual menus...

Perhaps in a future update

0 Kudos