topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 3:04 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Favorite Bookmarklets  (Read 5187 times)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Favorite Bookmarklets
« on: May 12, 2010, 08:23 PM »
I have 2 favorite bookmarklets.

The first is Double Back
It backs up 2 pages unless there's insufficient history, then it backs up 1 if possible:

javascript:N=history.length;if(N==2){history.go(-1)}else{history.go(-2)}

I wrote Double Back to fill in the gap between right clicking the back button to
get a list of pages, and hitting the back button twice.  Either way you're in the
position of hitting the back button 2 or more times to go back only 2 pages.
For some reason every backup button in the world overlooks the "backup
2 pages case." If there aren't 2 pages in the history then it tries to back up
one page so you don't feel like you clicked it for nothing! :)


The second is Mod which attempts to display the last modification date
of the current page:

javascript:alert(document.lastModified)

some sites won't allow this function, producing a blank dialog.
Sometimes the results are obviously flawed(January 1, 1970)

but it works on some sites and works in Google Chrome 5 Beta
(unlike SRWare Iron which showed blank on every page I tried.)

Can come in handy when reading a review that doesn't have a date
on the page, or some such similar scenario.   Better 'n nuthin' :)


« Last Edit: May 12, 2010, 08:27 PM by MilesAhead »

J-Mac

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 2,918
    • View Profile
    • Donate to Member
Re: Favorite Bookmarklets
« Reply #1 on: May 12, 2010, 10:02 PM »
A few of my favorites:

Remove Cookies
This one removes any cookies set by the current site. Useful if you don’t want those particular cookies and also don’t want to dump ALL your cookies.

javascript:(function(){C=document.cookie.split(";%20");for(d="."+location.host;d;d=(""+d).substr(1).match(/\..*$/))for(sl=0;sl<2;++sl)for(p="/"+location.pathname;p;p=p.substring(0,p.lastIndexOf('/')))for(i%20in%20C)if(c=C){document.cookie=c+";%20domain="+d.slice(sl)+";%20path="+p.slice(1)+"/"+";%20expires="+new%20Date((new%20Date).getTime()-1e11).toGMTString()}})()

View Password
This makes visible passwords that normally show as asterisks.

javascript:(function(){var%20s,F,j,f,i;%20s%20=%20"";%20F%20=%20document.forms;%20for(j=0;%20j<F.length;%20++j)%20{%20f%20=%20F[j];%20for%20(i=0;%20i<f.length;%20++i)%20{%20if%20(f.type.toLowerCase()%20==%20"password")%20s%20+=%20f.value%20+%20"\n";%20}%20}%20if%20(s)%20alert("Passwords%20in%20forms%20on%20this%20page:\n\n"%20+%20s);%20else%20alert("There%20are%20no%20passwords%20in%20forms%20on%20this%20page.");})();

I recently removed a bunch of mine that I really hadn't used in a long time.

Thanks!

Jim

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
Re: Favorite Bookmarklets
« Reply #2 on: May 13, 2010, 04:04 AM »
The first is Double Back
It backs up 2 pages unless there's insufficient history, then it backs up 1 if possible:

javascript:N=history.length;if(N==2){history.go(-1)}else{history.go(-2)}

I wrote Double Back to fill in the gap between right clicking the back button to
get a list of pages, and hitting the back button twice.  Either way you're in the
position of hitting the back button 2 or more times to go back only 2 pages.
For some reason every backup button in the world overlooks the "backup
2 pages case." If there aren't 2 pages in the history then it tries to back up
one page so you don't feel like you clicked it for nothing!

excellent. i've been wanting something to do that for years. thanks. (doesn't seem to work in Maxthon though?)
« Last Edit: May 13, 2010, 04:07 AM by nudone »

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: Favorite Bookmarklets
« Reply #3 on: May 13, 2010, 06:00 AM »
Krishean's Google Goo Remover that removes the tracking crap from links in Google search, so you can have clean links for copying:

Code: Javascript [Select]
  1. javascript:{function%20detect(el){var%20s=((el.toSource)?el.toSource():el.toString());return(s.indexOf('return%20rwt(')!=-1||s.indexOf('return%20clk(')!=-1);}var%20a=document.getElementsByTagName('a');for(var%20i=0;i<a.length;i++)if(a[i].className=='l'&&a[i].onmousedown&&detect(a[i].onmousedown))a[i].setAttribute('onmousedown','');void(0);};

Snailify It

On my old slow PC, this one is very handy when I hit a page that won't load well on an old slow computer. It takes you to the Google mobile version of the page.

Code: Javascript [Select]
  1. javascript:location.href='http://www.google.com/gwt/n?_gwt_pg=0&u='+document.location.href;

Zap Colors

When you hit a funky looking page that is too difficult to read because of the web designers choice of background and/or text colors, this one turns the page into black text on a white background with blue unvisited/purple visited links. (you'll never have to deal with lime green text with yellow links on a red background ever again)

Code: Javascript [Select]
  1. javascript:(function(){var%20newSS,%20styles='*%20{%20background:%20white%20!%20important;%20color:%20black%20!important%20}%20:link,%20:link%20*%20{%20color:%20#0000EE%20!important%20}%20:visited,%20:visited%20*%20{%20color:%20#551A8B%20!important%20}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet("javascript:'"+styles+"'");%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName("head")[0].appendChild(newSS);%20}%20})();

Backtype Connect

This one will show you some recent discussions and tweets associated with any page on the internet. (test it out here to see what it does) This is more handy for your own pages, to track references to it on the web. (Google Alerts can only go so far and misses a lot of what this picks up)

Code: Javascript [Select]
  1. javascript:location.href='http://www.backtype.com/connect/'+encodeURIComponent(location.href.substring(7).replace(new%20RegExp('/','g'),'%252f').replace(new%20RegExp('&','g'),'%2526'))+'?referrer'

These 2 work well together, for pages that have a lot of thumbnails linked to other pages, where you want to save a list of just the links, so you can hit them all later.

The first creates a page in a popup window, just listing all the links on the page:

Code: Javascript [Select]
  1. javascript:WN7z=open('','Z6','width=400,height=200,scrollbars,resizable,menubar');DL5e=document.links;with(WN7z.document){write('<base%20target=_blank>');for(lKi=0;lKi<DL5e.length;lKi++){write(DL5e[lKi].toString().link(DL5e[lKi])+'<br><br>')};void(close())}

This one hides all visited links, so all you see are the ones you haven't hit yet:

Code: Javascript [Select]
  1. javascript:(function(){var%20newSS,%20styles=':visited%20{display:%20none}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet(%22javascript:'%22+styles+%22'%22);%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName(%22head%22)[0].appendChild(newSS);%20}%20})();


MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Favorite Bookmarklets
« Reply #4 on: May 13, 2010, 02:39 PM »
Zap Colors is excellent!! Fixes those unreadable pages right up!! I tried a bunch of style sheets and this works much better!!

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Favorite Bookmarklets
« Reply #5 on: May 13, 2010, 02:46 PM »
Speaking of passwords, this one works with Firefox Secure Login AddOn(and likely others too)

after you fill in the login info, click to remove the stuff that blocks saving it

Remember Password

javascript:(function(){var%20ca,cea,cs,df,dfe,i,j,x,y;function%20n(i,what){return%20i+%22%20%22+what+((i==1)?%22%22:%22s%22)}ca=cea=cs=0;df=document.forms;for(i=0;i<df.length;++i){x=df[i];dfe=x.elements;if(x.onsubmit){x.onsubmit=%22%22;++cs;}if(x.attributes[%22autocomplete%22]){x.attributes[%22autocomplete%22].value=%22on%22;++ca;}for(j=0;j<dfe.length;++j){y=dfe[j];if(y.attributes[%22autocomplete%22]){y.attributes[%22autocomplete%22].value=%22on%22;++cea;}}}alert(%22Removed%20autocomplete=off%20from%20%22+n(ca,%22form%22)+%22%20and%20from%20%22+n(cea,%22form%20element%22)+%22,%20and%20removed%20onsubmit%20from%20%22+n(cs,%22form%22)+%22.%20After%20you%20type%20your%20password%20and%20submit%20the%20form,%20the%20browser%20will%20offer%20to%20remember%20your%20password.%22)})();