Quickly preview embeddable widget code such as a Twitter card or Instagram post, before adding it to your website code.
Copy the text of bookmarklet.txt
(below) into a new bookmark with a memorable name like "Preview Embed Code" and place it on your bookmarks bar.
- Select the embed code (some sites do this automatically)
- Press the bookmarklet
A new tab/window will open with the embed code loaded as a data URI. It assumes the embed will be adaptive by default, and adds a viewport meta tag, so you can quickly open your development tools and try different device sizes.
Note: Some embeds will try to load resources from protocol-relative URIs, which won't normally work in data URIs, but this bookmarklet adds the https:
protocol in these cases.