3 ms·
Hm, how does this work? How can JavaScript be executed like that when it's included as an image?
by Kiro 13y ago
Hm, how does this work? How can JavaScript be executed like that when it's included as an image?
- btcfn 13y agohttp://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#JavaScript http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#J...
- dpweb 13y agoCurious about that too. If I load an svg in the address bar with embedded script I can show alert(), but linked into html using <img> tag, alert does not run. Sandboxed? Otherwise I could execute JS just by loading in using svg via <img>.
- hughes 13y agoLooks like it's not sandboxed at all? > Any functions defined within any script element have a global scope across the entire current document. [0] https://developer.mozilla.org/en-US/docs/Web/SVG/Element/script https://developer.mozilla.org/en-US/docs/Web/SVG/Element/scr...
- spb 13y agoAs images / targets, SVG documents have their own global scope, much like a page in an iframe.