I'm taking a stab at building my first Chrome Extension. Basically what I want to do is, click the extension icon, grab the page title, URL, and selected content from the current page, open a new window, and pass that data into this new window.
I've got it most of the way there, but I'm having trouble figuring out how to execute code after the window is fully loaded.
Here is a gist with all of the files of the extension.
I want to execute the contentscript.js and insertdata.js code after the window has loaded, and to use jQuery on the pages (if it exists). For some reason, even if I set an interval to continuously check if $ was a function, it never was. I guess I don't understand why I can't access the JS functions available on the page.
Also, all of this code seems kind of convoluted, so I'm wondering if there is some better way to accomplish this. Thanks in advance for any help.