...
- In Chrome, click the three-bar icon in the top right, then 'Bookmarks', then 'Bookmark manager'.
- Right-click the 'Bookmarks bar' folder and select 'Add page'.
- For the 'Name', put 'Hello World!', and for the URL paste in the code below.
- javascript: alert('Hello World!');
- To test the bookmarklet, open a new tab and click the new bookmark.
How to launch a bookmark in Chrome with a keyboard shortcut
...
- Download an unofficial Chrome extension that does this for you.
- Go to this link: https://github.com/courage/bookmark-shortcuts (Source)
- Click 'Clone or download'.
- Click 'Download ZIP'.
- Click on the .zip file when it finishes downloading.
- Click 'Extract all files' in the top-left of the window.
- Click 'Extract' in the bottom-right of the UI that appears.
- Drag the folder to your Desktop.
- Enable the Chrome extension.
- In Chrome, click the three-bar icon in the top-right, then click 'Settings'.
- Click 'Extensions' in the left side-bar.
- Click 'Load unpacked extension' in the top-left of the main screen.
- In the modal that appears, navigate to Desktop → bookmark-shortcuts-master → app.
- Explanation: 'app' is the folder that contains the files that Chrome uses as the 'brains' of the extension.
- Click 'OK'.
- You should see the extension show up in the list of extensions.
- Set