Downside of the script from Tim is that when hovering over the link the broken link is shown. My script fixes the DOM.
// ==UserScript==
// @name Fix broken double links
// @namespace http://stackoverflow.com/users/578411/rene
// @version 0.1
// @description fix one-one-boxes
// @author rene
// @match *://chat.meta.stackexchange.com/*
// @match *://chat.stackexchange.com/*
// @match *://chat.stackoverflow.com/*
// @grant none
// ==/UserScript==
(function() {
// fix the link in the one box
function fixup(item) {
var a = $(item),
hrefs = a.prop('href').split('//');
if (hrefs.length > 2) {
hrefs.shift();
hrefs.shift();
a.prop('href', '//' + hrefs.join('//'));
}
}
// create an observer instance
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
var i,
box;
for(i=0; i< mutation.addedNodes.length; i = i + 1) {
box = $(mutation.addedNodes[i]);
console.log(box);
box.find('div.ob-post-title a').each(function () {
fixup(this);
});
}
});
});
// chat window
if ($('div#chat').length >0) {
console.log('obs');
observer.observe($('div#chat')[0], {childList:true, subtree: true});
}
//transcript
$('div.ob-post-title a').each(function () {
fixup(this);
});
}())