Hi
I've tried to use the LastPass bookmarklets to make webjumps so I can
use the functions in Conkeror. If I manually yank the javascript at
the find URL prompt, it works as expected:
javascript:(function(){/*Click_This_Button_To_AutoLogin___Copyright_LastPass_all_rights_reserved*/_LASTPASS_INC=function(u,s){if(u.match(/_LASTPASS_RAND/)){alert('Cancelling_request_may_contain_randkey');return;}s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('charset','UTF-8');s.setAttribute('src',u);if(typeof(window.attachEvent)!='undefined')document.body.appendChild(s);else{if(document.getElementsByTagName('head').length>0){document.getElementsByTagName('head').item(0).appendChild(s);}else{document.getElementsByTagName('body').item(0).appendChild(s);}}};_LASTPASS_RAND='0aed3ebb837e08684ccbe149944c37f84f39cacea35dce973bce405bdcfd7b5e';_LASTPASS_INC('https://lastpass.com/bml.php'+String.fromCharCode(63)+'v=0&a=1&r='+Math.random()+'&h=3fbdf1caa0f69799bb21c1f726caa591163d0faeaccedb2f7b5002b68413396c&u='+escape(document.location.href));})();
However, if I define a webjump with the same code:
define_webjump("lastpass login",
"javascript:(function(){/*Click_This_Button_To_AutoLogin___Copyright_LastPass_all_rights_reserved*/_LASTPASS_INC=function(u,s){if(u.match(/_LASTPASS_RAND/)){alert('Cancelling_request_may_contain_randkey');return;}s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('charset','UTF-8');s.setAttribute('src',u);if(typeof(window.attachEvent)!='undefined')document.body.appendChild(s);else{if(document.getElementsByTagName('head').length>0){document.getElementsByTagName('head').item(0).appendChild(s);}else{document.getElementsByTagName('body').item(0).appendChild(s);}}};_LASTPASS_RAND='0aed3ebb837e08684ccbe149944c37f84f39cacea35dce973bce405bdcfd7b5e';_LASTPASS_INC('https://lastpass.com/bml.php'+String.fromCharCode(63)+'v=0&a=1&r='+Math.random()+'&h=3fbdf1caa0f69799bb21c1f726caa591163d0faeaccedb2f7b5002b68413396c&u='+escape(document.location.href));})();");
and then attempt to use it, I get an error "The URL is not valid and
cannot be loaded".
I've previously used bookmarklets in a webjump for Evernote as below
(can't remember where I got this one, I didn't create it myself)
define_webjump("clip - evernote",
"javascript:(function(){EN_CLIP_HOST='http://www.evernote.com';try{var%20x=document.createElement('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new%20Date().getTime()/100000);document.getElementsByTagName('head')[0].appendChild(x);}catch(e){location.href=EN_CLIP_HOST+'/clip.action?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);}})();");
I can't see what fundamental difference there is that will make this
fail. Can anyone else see what the problem is?
Thanks
Paul
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror