Saturday 17 June 2017

javascript - Get a list of Available Functions on Tampermonkey

I currently have a Tampermonkey script with a series of contextualized functions that I provide as options to run when on a certain page.



A simplified version of my code would be:



window.func1 = function func1() {...}
window.func2 = function func2(a) {...}

window.func3 = function func3(a, b) {...}


I would like to have some function that could take the current script I have and provide me with a list of the available functions, something along the lines of:



>> getAvailableFunctions()
<< func1, func2, func3


I have been investigating with the Object.getOwnPropertyNames method, but I can't seem to pull that one out with Tampermonkey.




Can I have some input?



Thank you!

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...