Webview.loadURL is not a function


Trying to loop through some URLs and load them into my webview.

<webview id="loader" preload="preload.js" disablewebsecurity ></webview>


var loader = document.getElementById("loader");
loader.addEventListener("dom-ready", function() {

I’m getting a completely unexplainable error of :
Uncaught TypeError: loader.loadURL is not a function

Any ideas? Can I not use preload with loadURL or something? It’s literally that simple of code and it’s not working.


Ok, so it seems that unless a command for loader is inside an .addEventListener , it won’t fire. I have no clue why. Is there a fix for this?