Eg
javascript:/* name: /awesome# */alert(2+2)Eg
javascript:/* name: /awesome# */alert(2+2)Still interesting to look at Chromium's source to see that they have unit tests for bookmarklets [1]. Also looks like people "frequently" report running JS from bookmarks as an XSS vulnerability [2]
[1] https://github.com/chromium/chromium/blob/0acce829e996f8387c...
[2] https://github.com/chromium/chromium/blob/0acce829e996f8387c...
/* comment */
Bookmarklets, like bookmarks, also have names.I didn't phrase it very well but I figured people would just drag and drop it in Chrome and see it for themselves.
> I didn't phrase it very well but I figured people would just drag and drop it in Chrome and see it for themselves.
I did. I spent way too long (15+ minutes) doing that, trying variations of the bookmarklet and user interactions to see if doing so would cause some observable difference and reveal some insight, and trying on different plausible (and implausible) interpretations of your comment.
When I drag and drop this to the Chrome bookmark bar, it will create a new bookmarklet with the name "awesome"
javascript:/* name: /awesome# */alert(2+2)
It doesn't seem to work on Chromium on Ubuntu. I don't have a Mac to try it on, perhaps someone else can try it.I mean does it need a line break as it is seen in your code?