Is there a way to link to open all file extensions with default OS program instead of internal to Electron?
My file names are loaded from JSON file. (Value.url IS the file name pulled in dynamically during a search)
I modified my code below to link the click event to the openBtnId, but now i'm receivING "electron is not defined". I have const shell = require('electron').shell; in my mainJS.
function renderHTML(data) {
var htmlString = "";
$('#aceCategory').empty();
for (i = 0; i < data.length; i++) {
htmlString += "<p class='categoryName'>" + data[i].category + "</p>" + "<tr>" + "<td class='feedDesc'>" + "<b>" + data[i].name +
"</b>" + "<br>" + data[i].desc + "</br>" + "<br>" + "<input type='button' id='openBtn' style='border-radius: 25px; outline: none' value='Open Link' >" + "</td>" +
"</tr>";
}
aceFeedTable.insertAdjacentHTML('beforeend', htmlString)
$(document).on("click", "#openBtn", function() {
electron.shell.openItem(data[i].url);
});
}
I set nodeIntegration to true and added window.$ = window.jQuery = require('jquery'); to my mainWindow html. and now it recognizes shell.openItem.