An open API service indexing awesome lists of open source software.

https://github.com/imcuttle/open-one-window

Open the only one window
https://github.com/imcuttle/open-one-window

Last synced: about 1 year ago
JSON representation

Open the only one window

Awesome Lists containing this project

README

          

# open-one-window

[![Build status](https://img.shields.io/travis/imcuttle/open-one-window/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/open-one-window)
[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/open-one-window.svg?style=flat-square)](https://codecov.io/github/imcuttle/open-one-window?branch=master)
[![NPM version](https://img.shields.io/npm/v/open-one-window.svg?style=flat-square)](https://www.npmjs.com/package/open-one-window)
[![NPM Downloads](https://img.shields.io/npm/dm/open-one-window.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/open-one-window)
[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)

> Open the only one window

## Installation

```bash
npm install open-one-window
# or use yarn
yarn add open-one-window
```

## Usage

```javascript
const openOneWindow = require('open-one-window')
const oneWin = openOneWindow()

oneWin.open('http://example.com')
```

## API

### openOneWindow

[index.js:7-7](https://github.com/imcuttle/open-one-window/blob/e7919136d669472fc0710d20139bf1653e0ba5fa/index.js#L7-L7 "Source code on GitHub")

#### Parameters

- `options` {{}}
- `options.window` {Window} (optional, default `global`)
- `options.shouldFallback` Fallback the way when the browser is not chrome, It's will open every times when `false` (optional, default `true`)

Returns **[Window](https://developer.mozilla.org/docs/Web/API/Window)**

## Contributing

- Fork it!
- Create your new branch:
`git checkout -b feature-new` or `git checkout -b fix-which-bug`
- Start your magic work now
- Make sure npm test passes
- Commit your changes:
`git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`
- Push to the branch: `git push`
- Submit a pull request :)

## Authors

This library is written and maintained by imcuttle, moyuyc95@gmail.com.

## License

MIT - [imcuttle](https://github.com/imcuttle) 🐟