Finding and changing currencies using Greasemonkey
- by Noam Smadja
It doesnt find nor replaces the strings.. may be wrong regex?
// ==UserScript==
// @name CurConvertor
// @namespace CurConvertor
// @description noam smadja
// @include http://www.zavvi.com/*
// ==/UserScript==
textNodes = document.evaluate(
"//text()",
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
var searchRE = new RegExp('\d\d.\d\d','gi');
var replace = searchRE*5.67;
for (var i=0;i<textNodes.snapshotLength;i++) {
var node = textNodes.snapshotItem(i);
node.data = node.data.replace(searchRE, replace);
i wrote this, but its not doing a think. even when i change the string in the regex to a string in the webpage it still does nothing..
what am i missing? :)