One way would be to use a 'bookmarklet'. Those are small javascript snippets, which you can insert into your bookmark bar and then execute by clicking on them.
<a href="javascript:(function(){alert(1);})()">Drag me to bookmarks for alert</a>
For Example, drag the link in this fiddle into your bookmark bar and it will alert 1 on click. http://jsfiddle.net/5aAPN/2/