Chrome extensions are usually based on javascript. Nowadays, jQuery is always used/though of when javascript is mentioned. Thus, it’s essential to know how to use jQuery – at least in the popup.
To get familiar with chrome extension development – check this out.
To trigger something when the page is loaded in javascript it’s usually the famous
$(document).ready(function(){ //whatever });
This, unfortunately, will not work in the popup of your extension. Instead, I used another function
function ext_ready(){ //whatever } window.onload = ext_ready;
Ofcourse that is not my solution – but I read it somewhere long time ago that I forgot the resource. Probably it’s on stackoverflow somewhere.