Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sanitizeNode(node) {
- if (node.tagName != 'A')
- return;
- node.removeAttribute('onmousedown');
- }
- function walk(node) {
- // thanks to: http://is.gd/mwZp7E
- switch (node.nodeType) {
- case 1: // Node.ELEMENT_NODE
- sanitizeNode(node);
- case 9: // Node.DOCUMENT_NODE
- case 11: // Node.DOCUMENT_FRAGMENT_NODE
- var child = node.firstChild;
- while (child) {
- var next = child.nextSibling;
- walk(child);
- child = next;
- }
- break;
- }
- }
- walk(document.body);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement