sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

index.md (760B)


      1 Hide applets
      2 ============
      3 
      4 Description
      5 -----------
      6 
      7 This script must be deployed into the ~/.surf/user.js and it will hide all the java contents:
      8 
      9 	var elementNames = new Array("object","applet");
     10 
     11 	for(var i = 0; i < elementNames.length; i++) {
     12 		elements = document.getElementsByTagName(elementNames[i]);
     13 		for(var j = 0; j < elements.length; j++) {
     14 			var button = document.createElement("button");
     15 			button.appendChild(document.createTextNode("<" + elementNames[i] + ">"));
     16 			elements[j].parentNode.insertBefore(button, elements[j]);
     17 			button.onclick = function() {
     18 				this.nextSibling.style.display="";
     19 				this.style.display="None";
     20 				return false;
     21 			}
     22 			elements[j].style.display="None";
     23 		}
     24 	}
     25 
     26 Author
     27 ------
     28 
     29 * Enno Boland (Gottox) <g s01 de>