diff options
Diffstat (limited to 'data/lib/skip-bug.js')
-rw-r--r-- | data/lib/skip-bug.js | 19 |
1 files changed, 11 insertions, 8 deletions
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(); |