Skip to content

Instantly share code, notes, and snippets.

@kentbrew kentbrew/pinmarklet.md
Last active Sep 16, 2019

Embed
What would you like to do?
How to recreate your long-lost Pinterest bookmarklet.

How to recreate your long-lost Pinterest bookmarklet.

Right-click your bookmarks bar and choose Add Page (Chrome) or New Bookmarklet (Firefox).

In Name, put this:

Pin It

In URL, put this:

javascript:void((function(d){d.addEventListener('securitypolicyviolation',function(r){alert('ContentSecurityPolicyError!');});e=d.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('debug','true');e.setAttribute('src','//assets.pinterest.com/js/pinmarklet.js?r='+(Math.random()*99999999));d.body.appendChild(e);}(document)));

For My Little Friend Safari:

  • open about:blank in a new window (this will help you not have to mess around with favicons later)
  • hit command-D
  • choose Favorites under Add this page to:
  • enter Pin It in the Name box
  • right-click the Pin It bookmarklet you just made and choose Edit Address
  • paste in the JavaScript from above

If You're Running Chrome or Firefox, Pinmarklet will Bother You to Install the Pinterest Browser Extension

  • From time to time you'll see a big banner in the image grid, begging you to please install the extension.
  • If you don't want to install the extension, click the "no, thanks" button to set a two-week cookie.

Why you Might Want the Extension After All

  • Pinning with the extension is much better, especially if you pin a lot. You'll have free hovering Save buttons (which you can turn off in Settings) and you can right-click and pin an image without the intervening wait-for-the-grid / pick-an-image cycle.
  • Pinning happens right there inline instead of in a pop-up window.
  • You also get Visual Search for free. Right-click the body of the page to search a full screenshot, or choose the hovering selector button to search an individual image.
@felixfischer

This comment has been minimized.

Copy link

felixfischer commented Mar 5, 2017

👍 Thanks!

@CoolCanuck

This comment has been minimized.

Copy link

CoolCanuck commented May 19, 2017

Thanks very much!

@xnastasia

This comment has been minimized.

Copy link

xnastasia commented Jul 4, 2017

no favicon for chrome?

@kentbrew

This comment has been minimized.

Copy link
Owner Author

kentbrew commented Aug 16, 2017

Seriously: you really, really want the new Chrome extension. Visual search! Inline pinning! Go, download, enjoy: https://chrome.google.com/webstore/detail/pinterest-save-button/gpdjojdkbbmdfjfahjcgigfpmkopogic

@kentbrew

This comment has been minimized.

Copy link
Owner Author

kentbrew commented Apr 12, 2018

Just updated with a thing that will warn you if you're trying to execute on a page with a content security policy forbidding outside resources, such as GitHub.

@kentbrew

This comment has been minimized.

Copy link
Owner Author

kentbrew commented Aug 20, 2018

Here's a handy link showing how to set up a bookmarklet on an IOS device. Same approach will work for pinmarklet: https://paprikaapp.zendesk.com/hc/en-us/articles/114094153074-How-do-I-set-up-the-bookmarklet-on-my-iPad-

@kentbrew

This comment has been minimized.

Copy link
Owner Author

kentbrew commented Aug 28, 2018

Fixed up the URL. /max/ won't let those config params actually work, sorry!

@jessicandavis

This comment has been minimized.

Copy link

jessicandavis commented Aug 20, 2019

As of Aug 19, 2019, still working in Brave/Chromium--thanks! I don't see any advantages of the extension over the bookmarklet, either, except that I'm not able to get rid of the nag screen (see attached, from here). Can still opt for "no thanks," but it shows up every time I try to pin something new.

Is there a specific cookie or something I should block? Anything that can be done?
Annotation 2019-08-19 173035

@kentbrew

This comment has been minimized.

Copy link
Owner Author

kentbrew commented Sep 16, 2019

Pinterest is trying to set a seven-day cookie named bxn when you click that button but Brave is blocking it, since it's being set inside an iframe and (I am guessing) looks just like a cross-site cookie. When I change Brave's default settings to allow all cookies it works, but I will guess you don't want to do that.

If I could tell it was Brave by the user agent string I could probably fix this, but it's pretty generic: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36. Suggestions welcome!

[Edit: oh, maaan. I'd only used Brave on my mobile before ... it is SO SWEET on desktop!]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.