Page 1 of 1

How to get getpocket.com bookmarklet to work?

Posted: Sat Aug 16, 2014 10:44 pm
by gasull
Hi.

How can I get the bookmarklet from getpocket.com to work?

I tried whitelisting the domain and also adding it to the XSS exceptions list.

Here is the code of the bookmarklet:

Code: Select all

javascript:(function(){var%20e=function(t,n,r,i,s){var%20o=[6438157,2546409,3046843,4004400,5926100,5307858,2569290,6533563,4807441,1116719];var%20i=i||0,u=0,n=n||[],r=r||0,s=s||0;var%20a={'a':97,'b':98,'c':99,'d':100,'e':101,'f':102,'g':103,'h':104,'i':105,'j':106,'k':107,'l':108,'m':109,'n':110,'o':111,'p':112,'q':113,'r':114,'s':115,'t':116,'u':117,'v':118,'w':119,'x':120,'y':121,'z':122,'A':65,'B':66,'C':67,'D':68,'E':69,'F':70,'G':71,'H':72,'I':73,'J':74,'K':75,'L':76,'M':77,'N':78,'O':79,'P':80,'Q':81,'R':82,'S':83,'T':84,'U':85,'V':86,'W':87,'X':88,'Y':89,'Z':90,'0':48,'1':49,'2':50,'3':51,'4':52,'5':53,'6':54,'7':55,'8':56,'9':57,'\/':47,':':58,'?':63,'=':61,'-':45,'_':95,'&':38,'$':36,'!':33,'.':46};if(!s||s==0){t=o[0]+t}for(var%20f=0;f<t.length;f++){var%20l=function(e,t){return%20a[e[t]]?a[e[t]]:e.charCodeAt(t)}(t,f);if(!l*1)l=3;var%20c=l*(o[i]+l*o[u%o.length]);n[r]=(n[r]?n[r]+c:c)+s+u;var%20p=c%(50*1);if(n[p]){var%20d=n[r];n[r]=n[p];n[p]=d}u+=c;r=r==50?0:r+1;i=i==o.length-1?0:i+1}if(s==367){var%20v='';for(var%20f=0;f<n.length;f++){v+=String.fromCharCode(n[f]%(25*1)+97)}o=function(){};return%20v+'def1f717bd'}else{return%20e(u+'',n,r,i,s+1)}};var%20t=document,n=t.location.href,r=t.title;var%20i=e(n);var%20s=t.createElement('script');s.type='text/javascript';s.src='https://getpocket.com/b/r4.js?h='+i+'&u='+encodeURIComponent(n)+'&t='+encodeURIComponent(r);e=i=function(){};var%20o=t.getElementsByTagName('head')[0]||t.documentElement;o.appendChild(s)})()
Something very strange is that the bookmarklet works if I allow scripts from the domain I'm visiting. E.g. if I'm reading an article on nytimes.com that I want to save in getpocket.com, I need first to allow scripts from nytimes.com.

Why?

Thank you.

Re: How to get getpocket.com bookmarklet to work?

Posted: Sun Aug 17, 2014 1:56 am
by barbaz
This:

Code: Select all

var%20s=t.createElement('script');s.type='text/javascript';s.src='https://getpocket.com/b/r4.js?h='+i+'&u='+encodeURIComponent(n)+'&t='+encodeURIComponent(r);e=i=function(){};var%20o=t.getElementsByTagName('head')[0]||t.documentElement;o.appendChild(s)})()
Bottom line is, that bookmarklet is injecting an extra script tag into the page, so it requires that you have JS enabled on the host page and there's no way to work around it.
If you can't live with that, your best bet is to install Scriptish, dump the bookmarklet in a user script, then do something like modify it to register as a menu command which when run fetches the getpocket URL with GM_xml http Request and evaluates its contents directly as part of the user script somehow. But I'm not sure even that would work.

Re: How to get getpocket.com bookmarklet to work?

Posted: Mon Aug 18, 2014 3:06 am
by Thrawn
What exactly does GetPocket do? Can it be replaced with an extension?

Re: How to get getpocket.com bookmarklet to work?

Posted: Mon Aug 18, 2014 5:55 am
by gasull
Thrawn wrote:What exactly does GetPocket do? Can it be replaced with an extension?
You can save articles there to read them later. There are several similar services.