addyosmani / timing.js

Navigation Timing API measurement helpers
1.5k stars 114 forks source link

Bookmarklet code broken in Firefox #2

Open simevidas opened 10 years ago

simevidas commented 10 years ago

The javascript:!function () { … }(); format is not compatible with Firefox. I propose switching to javascript:(function () { … }());. (I'm referring to the Bookmarklet code displayed in the README.)

If a javascript:!function… bookmarklet is executed in Firefox, its code is loaded and executed inside the address bar, which in turn kills the current page. I guess, this is due to the code evaluating to true, unlike javascript:(function… which evaluates to undefined.

Note: This could be Windows-specific. Test here: http://jsfiddle.net/tot41ndo/ (drag into Bookmarks bar to test)