Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var scriptTag = document.createElement('script');
- scriptTag.type = 'text/javascript';
- scriptTag.src = 'https://wicked-good-xpath.googlecode.com/files/wgxpath.install.js';
- document.body.appendChild(scriptTag);
- function censor(censor) {
- return (function() {
- var i = 0;
- return function(key, value) {
- console.log(i,typeof(censor),'=====',typeof(value), value);
- if(i !== 0 && /*typeof(censor) === 'object' && typeof(value) == 'object' && */ censor == value)
- return null;
- console.log(i,typeof(censor),'=====',typeof(value), value);
- if(i >= 29) // seems to be a harded maximum of 30 serialized objects?
- return null;
- console.log(i,typeof(censor),'=====',typeof(value), value);
- ++i; // so we know we aren't using the original object anymore
- return value;
- }
- })(censor);
- }
- XPathResult = document.evaluate('**<SOME XPATH HERE>**', document, null, XPathResult.ANY_TYPE, null);
- var actualNode = XPathResult.iterateNext();
- var result = [];
- while (actualNode) {
- result.push(jQuery.makeArray(actualNode));
- actualNode = XPathResult.iterateNext();
- }
- console.log(result);
- console.log("Result: ", JSON.stringify(result, censor(result)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement