vimium: Bookmarklet doesn't run when executed through vomnibar

If I hit b and in the vomnibar try to run my “+ Pocket” bookmarklet (by hitting ENTER) nothing happends. If I click the bookmark manually in the bookmarks bar everything works fine. Worked fine a couple of days ago.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 51 (13 by maintainers)

Commits related to this issue

Most upvoted comments

OK. Thanks @marlun. So the bookmarklet is running, and appears to be running in the correct context. Which is a good start.

Here are three versions of the Pocket bookmarklet:

javascript:(function(){var e=function(t,n,r,i,s){var o=[1681363,3799528,2161300,2540919,5264808,2108548,4688354,3792361,2314604,5325129];var i=i||0,u=0,n=n||[],r=r||0,s=s||0;var a={'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 f=0;f<t.length;f++){var l=function(e,t){return a[e[t]]?a[e[t]]:e.charCodeAt(t)}(t,f);if(!l*1)l=3;var c=l*(o[i]+l*o[u%o.length]);n[r]=(n[r]?n[r]+c:c)+s+u;var p=c%(50*1);if(n[p]){var d=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==269){var v='';for(var f=0;f<n.length;f++){v+=String.fromCharCode(n[f]%(25*1)+97)}o=function(){};return v+'e0a93c0ccb'}else{return e(u+'',n,r,i,s+1)}};var t=document,n=t.location.href,r=t.title;var i=e(n);var s=t.createElement('script');})()
javascript:(function(){var e=function(t,n,r,i,s){var o=[1681363,3799528,2161300,2540919,5264808,2108548,4688354,3792361,2314604,5325129];var i=i||0,u=0,n=n||[],r=r||0,s=s||0;var a={'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 f=0;f<t.length;f++){var l=function(e,t){return a[e[t]]?a[e[t]]:e.charCodeAt(t)}(t,f);if(!l*1)l=3;var c=l*(o[i]+l*o[u%o.length]);n[r]=(n[r]?n[r]+c:c)+s+u;var p=c%(50*1);if(n[p]){var d=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==269){var v='';for(var f=0;f<n.length;f++){v+=String.fromCharCode(n[f]%(25*1)+97)}o=function(){};return v+'e0a93c0ccb'}else{return e(u+'',n,r,i,s+1)}};var t=document,n=t.location.href,r=t.title;var i=e(n);var s=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(){};})()
javascript:(function(){var e=function(t,n,r,i,s){var o=[1681363,3799528,2161300,2540919,5264808,2108548,4688354,3792361,2314604,5325129];var i=i||0,u=0,n=n||[],r=r||0,s=s||0;var a={'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 f=0;f<t.length;f++){var l=function(e,t){return a[e[t]]?a[e[t]]:e.charCodeAt(t)}(t,f);if(!l*1)l=3;var c=l*(o[i]+l*o[u%o.length]);n[r]=(n[r]?n[r]+c:c)+s+u;var p=c%(50*1);if(n[p]){var d=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==269){var v='';for(var f=0;f<n.length;f++){v+=String.fromCharCode(n[f]%(25*1)+97)}o=function(){};return v+'e0a93c0ccb'}else{return e(u+'',n,r,i,s+1)}};var t=document,n=t.location.href,r=t.title;var i=e(n);var s=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 o=t.getElementsByTagName('head')[0]||t.documentElement;o.appendChild(s)})()

The first two are abbreviated, the third is the full thing. The first two don’t do anything, but they shouldn’t produce any error messages on the console. Would you be able to check which is the first one to produce an error message?

Another thing to try is simply taking the full text of the Pocket bookmarklet (the third line above) and running it in the console (Ctrl-Shift-I).

I am also running into the same problem with the Twitter bookmarklet. For some reason, it is stored with URL escapes, unlike other bookmarklets.

javascript:%28function%28%29%7Bwindow.twttr%3Dwindow.twttr%7C%7C%7B%7D%3Bvar%20D%3D550%2CA%3D450%2CC%3Dscreen.height%2CB%3Dscreen.width%2CH%3DMath.round%28%28B%2F2%29-%28D%2F2%29%29%2CG%3D0%2CF%3Ddocument%2CE%3Bif%28C%3EA%29%7BG%3DMath.round%28%28C%2F2%29-%28A%2F2%29%29%7Dwindow.twttr.shareWin%3Dwindow.open%28%27https%3A%2F%2Ftwitter.com%2Fshare%27%2C%27%27%2C%27left%3D%27%2BH%2B%27%2Ctop%3D%27%2BG%2B%27%2Cwidth%3D%27%2BD%2B%27%2Cheight%3D%27%2BA%2B%27%2Cpersonalbar%3D0%2Ctoolbar%3D0%2Cscrollbars%3D1%2Cresizable%3D1%27%29%3BE%3DF.createElement%28%27script%27%29%3BE.src%3D%27https%3A%2F%2Fplatform.twitter.com%2Fbookmarklets%2Fshare.js%3Fv%3D1%27%3BF.getElementsByTagName%28%27head%27%29%5B0%5D.appendChild%28E%29%7D%28%29%29%3B

Hmm. I just got a different error…

Refused to load the script ‘https://getpocket.com/b/r4.js?h=XXXXXX… through vomnibar · Issue %231611 · philc%2Fvimium’ because it violates the following Content Security Policy directive: “script-src assets-cdn.github.com collector-cdn.github.com”.

Yes, I’m getting an error:

Uncaught SyntaxError: Unexpected token %                VM160:1