// ==UserScript==
// @name nobble
// @namespace http://news.bbc.co.uk/weather/forecast/346
// @include http://news.bbc.co.uk/weather/forecast/*
// ==/UserScript==
var div = document.getElementById("Forecast_main");
div.addEventListener("DOMNodeInserted", function() {
var textNodes = document.evaluate( "//text()", document, null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
var searchRE = new RegExp('mb','g');// I know doesn't need regexp for this
var replace = 'MB';
for (var i=0;i<textNodes.snapshotLength;i++) {
var node = textNodes.snapshotItem(i);
node.data = node.data.replace(searchRE, replace);
}
}, false);
Newer and better method(s):
http://www.w3.org/2008/webapps/wiki/MutationReplacement
> --
> You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
> To post to this group, send email to greasemon...@googlegroups.com.
> To unsubscribe from this group, send email to greasemonkey-us...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
>
>