ruby-dynamic-removal.js (374B)
1 function getElements(className) { 2 return Array.from(document.getElementsByClassName(className)); 3 } 4 window.onload = function() { 5 // Force a reflow before any changes. 6 document.body.clientWidth; 7 8 getElements('remove').forEach(function(e) { 9 e.remove(); 10 }); 11 getElements('remove-after').forEach(function(e) { 12 e.parentNode.removeChild(e.nextSibling); 13 }); 14 };