I want a generic way to find out the required parameters by a any javascript function including natives ones, but I'm unable to find one. I've seen this stackoverflow link, but it works only for functions that we define. toString() doesn't tell us about the function parameters of native functions like window.setTimeout() :
How to get function parameter names/values dynamically from javascript
I'm specifically interested in the GreaseMonkey methods like GM_setValue etc. , which behave similarly and don't show there parameters when used with toString() (I want to validate that a method passed to me has two parameters)