This isn't something you can easily do with just a plugin.
JavaScript can only do things in its own environment. There is a workaround using node.js: Link
As there is no use for such a plugin in C2 in general, I doubt that you will find someone who will script a working plugin for you for easy use (but I can also be wrong, so good luck).
Another way, that is maybe easier, is to develop your app as a google app following this instruction:
https://developer.chrome.com/apps/app_serial
Using the browser plugin, you can call javascript instructions directly in the event sheet... have not tested it (have absolutely no use for this), but I guess this could help you.