TrailbreakerMinimal/ChromeExtension/content.js
//Everytime the script is loaded, each a, img, and div element on the page will be given the notifyClick onClick event.
Everytime the script is loaded, each a, img, and div element on the page will be given the notifyClick onClick event.
Everytime the script is loaded each a img and div element on the page will be given the notifyClick onClick event .
function loadElems() {
    var aElems = window.document.getElementsByTagName("a");
    for (i = 0, max = aElems.length; i < max; i++) {
        aElems[i].onclick = notifyClick;
    }
    var imgElems = window.document.getElementsByTagName("img");
    for (i = 0, max = imgElems.length; i < max; i++) {
        imgElems[i].onclick = notifyClick;
    }
    var divElems = window.document.getElementsByTagName("div");
    for (i = 0, max = divElems.length; i < max; i++) {
        divElems[i].onclick = notifyClick;
    }
    var liElems = window.document.getElementsByTagName("li");
    for (i = 0, max = liElems.length; i < max; i++) {
        liElems[i].onclick = notifyClick;
    }
    window.document.onclick = notifyClick;
}
function loadElems ( ) { var aElems = window . document . getElementsByTagName ( "a" ) ; for ( i = 0 , max = aElems . length ; i < max ; i ++ ) { aElems [ i ] . onclick = notifyClick ; } var imgElems = window . document . getElementsByTagName ( "img" ) ; for ( i = 0 , max = imgElems . length ; i < max ; i ++ ) { imgElems [ i ] . onclick = notifyClick ; } var divElems = window . document . getElementsByTagName ( "div" ) ; for ( i = 0 , max = divElems . length ; i < max ; i ++ ) { divElems [ i ] . onclick = notifyClick ; } var liElems = window . document . getElementsByTagName ( "li" ) ; for ( i = 0 , max = liElems . length ; i < max ; i ++ ) { liElems [ i ] . onclick = notifyClick ; } window . document . onclick = notifyClick ; }
Everytime the script is loaded, each a, img, and div element on the page will be given the notifyClick onClick event.
Everytime the script is loaded each a img and div element on the page will be given the notifyClick onClick event .