Created
February 17, 2010 20:47
-
-
Save erikvold/306997 to your computer and use it in GitHub Desktop.
Userscript to fix JEP page titles on the Mozilla wiki.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Fix JEP Titles | |
// @namespace jepTitleFix | |
// @include https://wiki.mozilla.org/Labs/Jetpack/JEP/* | |
// @include https://wiki.mozilla.org/Labs/Jetpack/Reboot/JEP/* | |
// @datecreated 2010-02-17 | |
// @lastupdated 2010-02-17 | |
// @version 0.1 | |
// @author Erik Vergobbi Vold | |
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html | |
// @description Fixes the document.title of JEP pages. | |
// ==/UserScript== | |
(function(doc){ | |
var h2 = doc.evaluate("//h2/span[contains(@class,mw-headline)]",doc,null,9,null).singleNodeValue; | |
if(!h2 || !h2.innerHTML.match(/^\s*JEP [\d,]+\s-/)) return; | |
doc.title = h2.innerHTML.replace(/^\s+/gi,'').replace(/\s+$/gi,''); | |
})(document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment