From fb662574627c9bc3477ccfaacd4e96bfda1f3e29 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Tue, 3 Jan 2012 00:31:40 +0100 Subject: Hopefully fixes compatibility with bugs.eclipse.org. --- data/lib/skip-bug.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'data/lib') diff --git a/data/lib/skip-bug.js b/data/lib/skip-bug.js index 389eb54..4b4cd34 100644 --- a/data/lib/skip-bug.js +++ b/data/lib/skip-bug.js @@ -3,14 +3,17 @@ // "use strict"; function reloadPage() { - var titleElems = document.getElementsByTagName('title'); - if (titleElems) { - var REArr = new RegExp('[bB]ug\\s+([0-9]+)') - .exec(titleElems[0].textContent); - if (REArr) { - document.location = '/show_bug.cgi?id=' + REArr[1]; - } - } + var titleElems = document.getElementsByTagName('title'); + if (titleElems) { + var REArr = new RegExp('[bB]ug\\s+([0-9]+)') + .exec(titleElems[0].textContent); + if (REArr) { + var URLArr = document.location.path.split("/"); + document.location = URLArr.slice(0, URLArr.length - 1).join("/") + + "/show_bug.cgi?id=" + REArr[1]; + } + } } +console.log("asdasd"); reloadPage(); -- cgit