Travis build: 1964
This commit is contained in:
23
README.md
23
README.md
@ -206,6 +206,7 @@ average(1, 2, 3);
|
||||
* [`hashBrowser`](#hashbrowser-)
|
||||
* [`hide`](#hide)
|
||||
* [`httpsRedirect`](#httpsredirect)
|
||||
* [`isBrowserTabFocused`](#isbrowsertabfocused)
|
||||
* [`observeMutations`](#observemutations-)
|
||||
* [`off`](#off)
|
||||
* [`on`](#on)
|
||||
@ -3337,6 +3338,28 @@ httpsRedirect(); // If you are on http://mydomain.com, you are redirected to htt
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### isBrowserTabFocused
|
||||
|
||||
Returns `true` if the browser tab of the page is focused, `false` otherwise.
|
||||
|
||||
Use the `Document.hidden` property, introduced by the Page Visibility API to check if the browser tab of the page is visible or hidden.
|
||||
|
||||
```js
|
||||
const isBrowserTabFocused = () => !document.hidden;
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
isBrowserTabFocused(); // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### observeMutations 
|
||||
|
||||
Returns a new MutationObserver and runs the provided callback for each mutation on the specified element.
|
||||
|
||||
Reference in New Issue
Block a user