Advertisement
Guest User

AnonBU

a guest
Jun 18th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         All Anonymous Are ANBU
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.1
  5. // @description  Turns Anonymous <animal> into ANBU <animal>
  6. // @author       MeatcarpetPrincess
  7. // @match        https://docs.google.com/*
  8. // @grant        none
  9. // ==/UserScript==
  10. var observer = new MutationObserver(function() {
  11.         var special = document.querySelectorAll( "div.docs-presence-plus-collab-widget-container" );
  12.         special.forEach(function (currentValue, currentIndex, listObj){
  13.             var regex = /Anonymous/;
  14.             var animalName = currentValue.getAttribute("data-tooltip");
  15.             if (animalName != null){
  16.                 currentValue.setAttribute("data-tooltip", animalName.replace(regex, "ANBU"))
  17.                 //console.log(currentValue.getAttribute("data-tooltip"));
  18.             }
  19.         });
  20. });
  21. var content = document.getElementById('docs-presence-container');
  22. if (content){
  23.     observer.observe(content, { childList: true, subtree: true });
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement