I am developing a settings page for a chrome extension. In my options.js file I want to initalize the settings with some default values and I use window.onload = initSettings(); for that. In my initSettings() function I am trying to access an input from the DOM via document.getElementById("someId"). But this call always returns null. I thought that the window.onload event is fired after all of the DOM elements are in place.
What am I doing wrong?
I have this in the top of my options.js file – It’s been so long since I last played with extensions, I can’t be sure it’s of any help. Worth a shot..