There is no native API for copying a line; you could write your own function to do it yourself, or you could hack something up that selects the line and sends a
click
event to the appropriate button. The latter would likely not be supported as you'd need to use a DOM selector to find the right button