News for hackers. Stuff that matters.
Re:Show HN: The JavaScript Way, a book for learning modern J... by tomc1985 on Thursday July 27, 2017 @07:45PM (#14870789)
You could start with, "type 'javascript:alert(2+2);'" in your address bar
Re:Show HN: The JavaScript Way, a book for learning modern J... by jdnier on Thursday July 27, 2017 @10:12PM (#14871387)
Works in Firefox, not in Chrome (at least on MacOS).
Re:Show HN: The JavaScript Way, a book for learning modern J... by yorwba on Friday July 28, 2017 @12:51AM (#14872066)
What about

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

?
Re:Show HN: The JavaScript Way, a book for learning modern J... by ConfucianNardin on Friday July 28, 2017 @06:50AM (#14873306)
Works in both Chrome and Firefox.
Re:Show HN: The JavaScript Way, a book for learning modern J... by tomc1985 on Thursday July 27, 2017 @10:25PM (#14871444)
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.
Re:Show HN: The JavaScript Way, a book for learning modern J... by striking on Thursday July 27, 2017 @10:34PM (#14871491)
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...
Re:Show HN: The JavaScript Way, a book for learning modern J... by johnhenry on Thursday July 27, 2017 @11:51PM (#14871824)
Works if you type it out. If you paste it, the "javascript:" part will be omitted.
Re:Show HN: The JavaScript Way, a book for learning modern J... by abhinickz on Friday July 28, 2017 @05:50AM (#14873113)
Above works even if you paste it.