Hacker News new | ask | show | jobs
by jdnier 3253 days ago
Works in Firefox, not in Chrome (at least on MacOS).
3 comments

What about

  data:text/html,<script>alert(2+2)</script>

?
Works in both Chrome and Firefox.
Doesn't work in Chrome (edit: or Firefox for that matter) for Windows either... that's a shame. Abusing javascript: is a really useful trick for lots of little hacks.
It's also an attack vector for hacks. You can enable it on some browsers if you please, but having it off by default is sensible...
Works if you type it out. If you paste it, the "javascript:" part will be omitted.
Above works even if you paste it.