Why doesn’t the “Press This” bookmarklet work on GitHub?

This is due to the Content Security Policy (CSP) that Github rolled out in April 2013. CSP shouldn’t cause problems with bookmarklets, but it does in practice.

The issue isn’t specific to PressThis either. It causes problems with bookmarklets from Pinboard, Pocket and Instapaper.

In Chrome you can hit F12 to open the developer tools and see the error:

Error message in the Chrome developer tools console after attempting to use the Pocket bookmarklet on a Github page


tech