geeoharee

langer:

Ugh, so, seeing as Social Media Specialists refuse to stop shortening their links with those god awful stumbleupon/owly/etc things that put those stupid bars on the top of the page that every time I see them literally make me want to literally stab myself (and/or other people), I wrote1 a detection script that gets rid of those stupid bars by automatically redirecting you to the actual page that you were actually trying to actually visit in the first place.

So if you use Chrome you can first install this thing called dotjs and then put this jobber2 in your ~/.js/default.js (also available on my github):

jQuery(function() {
  var pattern;
  pattern = /([-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4})+\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)+/;
  if (pattern.test(window.location.pathname)) {
    var url = pattern.exec(window.location.pathname)[0];
    if (url.indexOf('http') == 0) {
      window.location = url;
    } else {
      window.location = 'http://' + url;
    }
  }
});

1by “wrote” I mean “reengineered some leftover code from my failled ‘startup’ formerly known as dashbrd formerly known as immerss”

2this might break shit for you, idk, ymmv, etc

Will this catch ALL those stupid bar sites? brb installing

  1. slaneofthought reblogged this from langer and added:
    This is an amazing idea. Can’t wait
  2. geeoharee reblogged this from langer and added:
    Will this catch ALL...bar sites? brb installing
  3. stevespillman said: more like made ME something
  4. justsayjolie said: You glorious nerd, you!
  5. distorte said: Lots of Social Media Specialists at my work. They fuck up a lot of my websites.
  6. langer posted this