Skip to content

Instantly share code, notes, and snippets.

@kennethreitz
Created July 22, 2011 05:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kennethreitz/1098949 to your computer and use it in GitHub Desktop.
Save kennethreitz/1098949 to your computer and use it in GitHub Desktop.
Instapaper Chrome Extension
<script>
chrome.browserAction.onClicked.addListener(function(tab) {
var script = "function iprl5(){var d=document,z=d.createElement('scr'+'ipt'),b=d.body,l=d.location;try{if(!b)throw(0);d.title='(Saving...) '+d.title;z.setAttribute('src',l.protocol+'//www.instapaper.com/j/pUgLJLCrwjg0?u='+encodeURIComponent(l.href)+'&t='+(new Date().getTime()));b.appendChild(z);}catch(e){alert('Please wait until the page has loaded.');}}iprl5();void(0)"
chrome.tabs.executeScript(tab.id, {code: script});
});
</script>
{
"name": "Instapaper",
"description": "Add the current page to your Instapaper List",
"version": "1.0",
"background_page": "background.html",
"icons": {
"128": "icon_128.png",
"48": "icon_48.png"
},
"permissions": [ "tabs", "http://*/*", "https://*/*" ],
"browser_action": {
"default_title": "Instapaper",
"default_icon": "icon_32.png"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment