Jump to content

Do you have errors on this site?well your'e problems will face away[operation aborte]

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
developercrowd

developercrowd

    Newbie

  • Members
  • Pip
  • 3 posts
this is the script for you to enjoy

jscript hack

function() {
    // Feature switches
    // WARNING: 'true' may cause alternate program flow.
    var f1 = PREVENT_POTENTIAL_OCCURANCES = false;
    var f2 = BREAK_INTO_DEBUGGER_AT_POTENTIAL_OCCURANCES = true;
    if (!window.console) {
        window.console = {};
        window.console.warn = function() { };
    }
    var frontierCheck = function(host) {
        // Is host on the frontier?
        while (host && (host != document.documentElement)) {
            if (host.parentNode && (host.parentNode.lastChild != host))
            // This is not on the frontier
                return true;
            host = host.parentNode;
        }
        if (!host || (host != document.documentElement))
            return true; // This node is not on the primary tree
        // This check is overly cautious, as appends to
        // the parent of the running script element are
        // OK, but the asynchronous case means that the
        // append could be happening anywhere and intrinsice
        // knowledge of the hosting application is required
        console.warn("Potential case of operation aborted");
        if (f2)
            debugger;
        // Step up two levels in the call stack
        // to see the problem source!!
        if (f1)
            return false;
        else
            return true;
    }
    var nativeAC = Element.prototype.appendChild;
    Element.prototype.appendChild = function() {
        // call looks like this:
        //    object.appendChild(object)
        // Go back one more level in the call stack!!
        if (frontierCheck(this))
            return nativeAC.apply(this, arguments);
    }
    var nativeIH = Object.getOwnPropertyDescriptor(Element.prototype, "innerHTML").set;
    Object.defineProperty(Element.prototype, "innerHTML", { set: function() {
        if (frontierCheck(this))
            nativeIH.apply(this, arguments);
    }
    });
})();
:bad:

Edited by Jaan, 04 December 2009 - 04:38 PM.
Please use code tags when you are posting your codes!


#2
James.H

James.H

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 866 posts
So what does this do exactly ?