Sharebee usability

By Raycast Last update Nov 1, 2007 — Installed 1,605 times. Daily Installs: 1, 1, 2, 7, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 2, 3, 0, 0, 3, 2, 2, 1, 0, 0, 1, 1, 5, 1, 1, 2, 3, 2
// ==UserScript==
// @name          Sharebee usability
// @namespace     http://heaven.universe/
// @description   Remove some usabilly annoyance of sharebee: make links into real links
// @include       http://sharebee.com/
// ==/UserScript==

var reg = /window\.open\('([^']*)'\);/;
var allLinks, thisLink;
allLinks = document.evaluate(
    "//a[@onclick]",
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null);
for (var i = 0; i < allLinks.snapshotLength; i++) {
    thisLink = allLinks.snapshotItem(i);
    var onclick = thisLink.getAttribute("onclick");
    var hits = reg.exec(onclick);
    if (hits && hits.length >= 1) {
      thisLink.setAttribute("href", hits[1]);
      thisLink.removeAttribute("onclick");
    }
}