Skip to content

lyrictenor/electron-open-link-in-browser

Repository files navigation

electron-open-link-in-browser

NPM version Travis-CI Status Appveyor Status Daviddm Status

Open a link in browser for Electron and browser.

Electron app to browser

Electron to browser

browser to browser

browser to browser

Install

$ npm install --save electron-open-link-in-browser

Usage

<script type="text/javascript" src="build/electron-open-link-in-browser.js"></script>
<a
  href="https://github.com/lyrictenor/electron-triage-for-github"
  onClick="electronOpenLinkInBrowser();"
  >
  github.com/lyrictenor/electron-triage-for-github
</a>

<button
  type="button"
  onclick="electronOpenLinkInBrowser('http://example.com');"
  >
  Example.com
</button>

React.js + JSX + Browserify/Webpack

var electronOpenLinkInBrowser = require("electron-open-link-in-browser");

<a
  href="https://github.com/lyrictenor/electron-triage-for-github"
  onClick={electronOpenLinkInBrowser.bind(this)}
  >
  github.com/lyrictenor/electron-triage-for-github
</a>

<button
  type="button"
  onClick={electronOpenLinkInBrowser.bind(this, "http://example.com")}
  >
  Example.com
</button>

API

electronOpenLinkInBrowser([url,] event)

Jump to the href property.

url

Optional

Type: string

Jump to url.

Changelog

changelog.md.

License

MIT © sanemat