Created
October 5, 2015 20:45
-
-
Save lazamar/adb3c338f3222466b594 to your computer and use it in GitHub Desktop.
Make all links of an Electron project open in the OS Browser instead of the project's window.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Little function to make all links of a page in an Electron project | |
// open in the OS Browser instead of the Project's window. | |
linksArray = document.getElementsByTagName("a"); | |
for (var i = 0; i < linksArray.length; i++) { | |
linksArray[i].setAttribute("onclick","app.openInBrowser('" + linksArray[i].href + "')"); | |
linksArray[i].href = "#"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment