Open link in default browser


#1

Hello, so I’m using a for…in loop to create html elements from objects in a JSON file. Each object in the JSON has a url. The URL is displayed for each objects html element. I’m trying to create a way so when you click the link it opens up in the default browser. I think I have it, but for some reason, nothing happens. Could someone tell me why? My current code:

var shell = require("electron").shell;
$(".proLink").on("click", function(e) {
   e.preventDefault();
   shell.openExternal($(this).text());
})