nw.js-external-linker.js
v1.0.4
Published
Forces all external links to open in regular browser windows in nw.js apps.
Downloads
4
Readme
nw.js-external-linker
A plugin for nw.js which forces all external links to open in the user's default browser outside your app.
Installation
Either download the file from here or use bower:
bower install nw.js-external-linker.js
Initialization
Include the file in your nw.js app:
<script>
global.window = window; // needed by externally linked scripts
</script>
<script src='bower_components/nw.js-external-linker.js/nw.js-external-linker.js'></script>
Usage
Once the script is loaded, all external links will automatically be opened in the user's default browser.
The script scans for:
rel='external'
target='_blank'
target='_top'
- Links beginning with
http
Links not meeting that criteria are assumed to not be external links.
Override
You can override this behavior by specifying target='_self'
in your links.
License
All original code in this library is licensed under the Creative Commons Attribution 4.0 International License. Commercial and noncommercial use is permitted with attribution.