Webview.loadURL is not a function


#1

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

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

js:

var loader = document.getElementById("loader");
loader.loadURL("http://youtube.com/feed/subscriptions");
loader.addEventListener("dom-ready", function() {
  //loader.executeJavaScript(exeString);
  console.log("loaded");
});

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.


#2

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?