Live data from Hacker News

Show HN: Doom Inside an SVG

chrisdalke.com

1–10 of 14 posts

Re: Show HN: Doom Inside an SVG

#2
I got nerd sniped by a tweet talking about JavaScript in SVG, and set out to find out if I could run DOOM inside an image. And it works, with some caveats.

This is technically an SVG that plays DOOM, including audio and interactivity. Pretty cool, although I'm not sure who had the bright idea to allow Javascript in SVG...

The SVG is just using to create an HMTL namespace, creating a canvas, and then running js-dos / DOSBox in the canvas.

The big caveat, probably a good thing, is that JavaScript in SVG only works if you load the SVG directly and not inside an , since browsers block this as an XSS prevention.

So this is not portable and can't be embedded in a webpage, but I guess was a fun use of a few hours...

Re: Show HN: Doom Inside an SVG

#4

I got nerd sniped by a tweet talking about JavaScript in SVG, and set out to find out if I could run DOOM inside an image. And it works, with some caveats. This is technically an SVG that plays DOOM, including audio and interactivity. Pretty cool, although I'm not sure who had the bright idea to allow Javascript in SVG... The SVG is just using to create an HMTL namespace, creating a canvas, and then running js-dos /…

> Pretty cool, although I'm not sure who had the bright idea to allow Javascript in SVG...

Is the decision making process public and transparent? Can we find out what committee made the decision, and when? Who the members were and their individual votes?

Re: Show HN: Doom Inside an SVG

#5

I got nerd sniped by a tweet talking about JavaScript in SVG, and set out to find out if I could run DOOM inside an image. And it works, with some caveats. This is technically an SVG that plays DOOM, including audio and interactivity. Pretty cool, although I'm not sure who had the bright idea to allow Javascript in SVG... The SVG is just using to create an HMTL namespace, creating a canvas, and then running js-dos /…

> Pretty cool, although I'm not sure who had the bright idea to allow Javascript in SVG... Is the decision making process public and transparent? Can we find out what committee made the decision, and when? Who the members were and their individual votes?

Yes. It's a W3C specification.

That said, the original 2001 version of the spec includes scripting https://www.w3.org/TR/2001/REC-SVG-20010904/REC-SVG-20010904... - so some decisions may be lost to time.

Re: Show HN: Doom Inside an SVG

#7
Heh, first the ZMachine runs under a PostScript file with the GhostScript interpreter, now this.

But this is a bit of cheating, because it's spawning HTML+JS inside a SVG as a foreign interface in a browser.

zmachine.ps has the whole interpreter in the PS file itself, as it's a Turing Complete language. Yes, you can play Zork on it.

Re: Show HN: Doom Inside an SVG

#8

I got nerd sniped by a tweet talking about JavaScript in SVG, and set out to find out if I could run DOOM inside an image. And it works, with some caveats. This is technically an SVG that plays DOOM, including audio and interactivity. Pretty cool, although I'm not sure who had the bright idea to allow Javascript in SVG... The SVG is just using to create an HMTL namespace, creating a canvas, and then running js-dos /…

> Pretty cool, although I'm not sure who had the bright idea to allow Javascript in SVG... Is the decision making process public and transparent? Can we find out what committee made the decision, and when? Who the members were and their individual votes?

A developer who worked on the webkit SVG implementation went into some of the history in a HN comment: https://news.ycombinator.com/item?id=39082633

Re: Show HN: Doom Inside an SVG

#9
post #8

Earlier quoted context omitted.

> Pretty cool, although I'm not sure who had the bright idea to allow Javascript in SVG... Is the decision making process public and transparent? Can we find out what committee made the decision, and when? Who the members were and their individual votes?

A developer who worked on the webkit SVG implementation went into some of the history in a HN comment: https://news.ycombinator.com/item?id=39082633

Wow that comment is super detailed, thanks for linking that.

“ IIRC the end solution that every browser went for was to just say "screw this" and drop most SVG features from SVGs loaded through image elements.”

Post reply on HN