Search code examples
javascriptflashspyware

is it possible using javascript to delete this hidden Zugo Flash movie on my page


The following hidden Flash movie is appearing on pages I am coding; until I figure out how to remove it from my system, is it possible using javascript to find it and delete it? Its container's id might change.

<div id="SiUnhdqlqHN9t7wB_tbstore_container" 
        style="left:-2000px; top:-2000px; position:absolute;">
    <param name="movie" value="http://tbupdate.zugo.com/ztb/2.5/jsi/man/fc.swf"/>
    <param name="allowScriptAccess" value="always"/>

Solution

  • Don't spend time on workarounds. Stop everything and find out why this is happening, and when you find it, squash it flat.

    Having said that, if I assume the param elements are within the div and that the div doesn't contain anything else, then:

    var list = document.getElementsByTagName('div');
    var index;
    var div;
    for (index = 0; index < list.length; ++index) {
        div = list[index];
        if (div.id.indexOf("store_container") !== -1) {
            div.parentNode.removeChild(div);
            break;
        }
    }
    

    Or if you're using a browser with querySelector, it's a lot easier because you can use the attribute ends with selector:

    var div = document.querySelector("div[id$=store_container");
    if (div) {
        div.parentNode.removeChild(div);
    }
    

    But again: Much more important to spend time fixing the actual problem, not on workarounds.