0

In a web page, it may import external javascript files, and it may contains inline javascript code, it may also use a activex control which may also expose javascript api, then how can I know all the functions available there in a web page?

1 Answer 1

1

You could iterate over the window object and filter the functions:

function getFunctions(obj)
{
    var functions = {};
    for (var attr in obj)
    {
        if ( typeof(obj[attr])=="function" )
        {
                functions[attr] = obj[attr];
        }
    }
    return functions;
}

var functions = getFunctions(window);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.