Skip to content

Instantly share code, notes, and snippets.

@cocoabox
Created January 10, 2015 10:58
Show Gist options
  • Save cocoabox/84747f28e6c124d7fc79 to your computer and use it in GitHub Desktop.
Save cocoabox/84747f28e6c124d7fc79 to your computer and use it in GitHub Desktop.
bookmarklet to download g+ pics in original resolution
javascript:var last_url='';var l = document.getElementsByTagName('div');var cnt = 0;for (var i = 0; i < l.length; ++i) { var s = l[i].getAttribute('style');if ('string'!== typeof s || !s) {continue;}s = s.replace(/\s+/g, '').toLowerCase(); if ((-1<s.indexOf('opacity:1;') ||-1<s.indexOf('z-index:0;'))&&s.match(/height:[0-9]+/g)&&s.match(/width:[0-9]+/g)) { var im = l[i].getElementsByTagName('img'); if (im && im.length) { for (var j = 0; j < im.length; ++j) {var u='https:' + im[j].getAttribute('src');if(u && 'string'===typeof u && u.indexOf('gstatic.com')==-1 && (u.indexOf('.jpg')>-1 || u.indexOf('.png'>-1))){u = u.replace(/w[0-9]+\-h[0-9]+/g,'w9999-h9999');if(u!=last_url){window.open(u,'img_window');last_url = u;++cnt;}} } } }}if(!cnt) {alert('SORRY');}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment