Update
Looks like browsers are starting to support copy natively in JS
In the console windows of both Chrome and Firefox on Mac I can execute
copy("party in your clipboard!");
and the text gets copied to my clipboard. I have searched SO and Google and can’t seem to find anything on this.
- Are these specific to each browser?
- Where can I find more information on
these JavaScript functions?
Browser versions:


JavaScript returned from Chrome console when executing ‘copy’
function (object)
{
if (injectedScript._type(object) === "node") {
var nodeId = InjectedScriptHost.pushNodePathToFrontend(object, false, false);
InjectedScriptHost.copyNode(nodeId);
} else
InjectedScriptHost.copyText(object);
}
- What does this code mean?
Here are 2 screenshots of executing copy function in Chrome console with all chrome extensions disabled


I believe these are predefined Firebug console functions – at least that seems to be the case for Firebug. If you try calling
window.copyfor instance, you’ll get a warning about function not defined, so it’s definitely not a browser function, and cannot be used in normal JavaScript files. The following functions also seems to work in the JavaScript console, after playing around with it a bit:clear()profile()Running these in the Chrome console reveals the source behind these functions in the Webkit console:
While the Firebug source also defines a list of functions: