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
- Host: GitHub
- URL: https://github.com/imcuttle/open-one-window
- Owner: imcuttle
- License: mit
- Created: 2019-04-25T12:12:38.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-07T14:06:55.000Z (over 4 years ago)
- Last Synced: 2025-03-27T17:23:00.745Z (about 1 year ago)
- Language: JavaScript
- Size: 147 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: License
Awesome Lists containing this project
README
# open-one-window
[](https://travis-ci.org/imcuttle/open-one-window)
[](https://codecov.io/github/imcuttle/open-one-window?branch=master)
[](https://www.npmjs.com/package/open-one-window)
[](https://www.npmjs.com/package/open-one-window)
[](https://prettier.io/)
[](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) 🐟