Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. var doFilter = function(textNode) {
  2. textNode.data = textNode.data.replace('Зеленського', 'Пусте місце');
  3. textNode.data = textNode.data.replace('Зеленському', 'Пусте місце');
  4. textNode.data = textNode.data.replace('Зеленському', 'Пусте місце');
  5. textNode.data = textNode.data.replace('Зеленський', 'Пусте місце');
  6. textNode.data = textNode.data.replace('Зеленську', 'Пусте місце');
  7. textNode.data = textNode.data.replace('Зеленській', 'Пусте місце');
  8. textNode.data = textNode.data.replace('ЗЕ!', 'Пусте місце');
  9. textNode.data = textNode.data.replace('Зе!команда', 'Пусте місце');
  10.  
  11. //на мокшанській
  12.  
  13. textNode.data = textNode.data.replace ( 'Зеленского', 'Пустое место');
  14. textNode.data = textNode.data.replace ( 'Зеленскому', 'Пустое место');
  15. textNode.data = textNode.data.replace ( 'Зеленский', 'Пустое место');
  16. textNode.data = textNode.data.replace ( 'Зеленская', 'Пустое место');
  17. }
  18.  
  19. var observer = new MutationObserver(function(mutations) {
  20. mutations.forEach(function(mutation) {
  21. if (mutation.addedNodes) {
  22. [].slice.call(mutation.addedNodes).forEach(function(node) {
  23. if (node.nodeName.toLowerCase() == "#text") {
  24. doFilter(node);
  25. }
  26. });
  27. }
  28. });
  29. });
  30.  
  31. observer.observe(document, {
  32. childList: true,
  33. subtree: true
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement