Computer >> Computer tutorials >  >> Programming >> Javascript

How to secretly copy to clipboard JavaScript function in Chrome and Firefox?


To secretly copy JavaScript function to clipboard, use any of the following method: clear() and profile(). These functions work on JavaScript console as well, 

For clear(),

InjectedScriptHost.clearConsoleMessages();

For profile(),

console.profile.apply(console, arguments)

For copy(),

InjectedScriptHost.copyText(object);