Travis build: 1964

This commit is contained in:
30secondsofcode
2018-04-15 16:19:51 +00:00
parent 99ac5a6137
commit 7ed767059d
12 changed files with 36 additions and 11 deletions

View File

@ -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 ![advanced](/advanced.svg)
Returns a new MutationObserver and runs the provided callback for each mutation on the specified element.