Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrecarlucci/fb1ad3caf46af7eea33cc3bf67d264d9 to your computer and use it in GitHub Desktop.
Save andrecarlucci/fb1ad3caf46af7eea33cc3bf67d264d9 to your computer and use it in GitHub Desktop.
Tampermonkey script tp add #gratidao to all messages on whatsapp web #ironic
// ==UserScript==
// @name MVP Gratidao
// @namespace http://tampermonkey.net/
// @version 0.1
// @description add #gratidao to all messages on whatsapp web
// @author You
// @match https://web.whatsapp.com/
// @grant none
// ==/UserScript==
(function() {
'use strict';
function appendContentInContainer(selector, content) {
var nodeList = document.querySelectorAll(selector);
for (var i = 0, length = nodeList.length; i < length; i++) {
if(nodeList[i].nodeName === 'SPAN' && !nodeList[i].innerHTML.endsWith(content)) {
nodeList[i].innerHTML = nodeList[i].innerHTML + content;
}
}
}
setInterval(function() {
appendContentInContainer('.selectable-text', ' #gratidao');
}, 250);
console.log('gratidao started');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment