https://github.com/arnellebalane/master-tab
Controls which tab should be the master tab when opening a page in multiple browser tabs
https://github.com/arnellebalane/master-tab
browser hacktoberfest npm-package
Last synced: 3 months ago
JSON representation
Controls which tab should be the master tab when opening a page in multiple browser tabs
- Host: GitHub
- URL: https://github.com/arnellebalane/master-tab
- Owner: arnellebalane
- License: mit
- Created: 2018-10-04T08:02:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-06T10:02:02.000Z (over 6 years ago)
- Last Synced: 2025-02-03T19:08:58.566Z (4 months ago)
- Topics: browser, hacktoberfest, npm-package
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@arnellebalane/master-tab
- Size: 174 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# MasterTab
Controls which tab should be the master tab when opening a page in multiple browser tabs.
## Installation
Install via npm (or yarn):
```bash
npm install @arnellebalane/master-tab
```Or via CDN (unpkg.com):
```html
```
## Usage
This module exposes an event emitter object to which you can attach event
listeners to observe changes to the current tab's state.```js
import MasterTab from '@arnellebalane/master-tab';MasterTab.on('change', isMaster => {
// ...
});
```This object is exposed as `window.MasterTab` when not using AMD or CommonJS.
## Events
The `MasterTab` object emits the following events with corresponding arguments
to the callback function:- **`change`**
- Emitted when the current tab's master state changes.
- The following arguments are passed to the callback function:
- **`isMaster`**: A boolean value indicating whether the current tab is the
master tab or not.## License
MIT License