PHPackages                             peterfriz/yii2-page-visibility - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. peterfriz/yii2-page-visibility

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

peterfriz/yii2-page-visibility
==============================

JS plugin that enables reacting to changes in the visibility state of a webpage

08JavaScript

Since Apr 18Pushed 10y ago1 watchersCompare

[ Source](https://github.com/peterfriz/yii2-page-visibility)[ Packagist](https://packagist.org/packages/peterfriz/yii2-page-visibility)[ RSS](/packages/peterfriz-yii2-page-visibility/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-page-visibility
====================

[](#yii2-page-visibility)

JS plugin that enables reacting to changes in the visibility state of a webpage.

This simple plugin wraps the [Page Visibility functionality](https://www.w3.org/TR/page-visibility/) for a Yii2 application.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require peterfriz/yii2-page-visibility "dev-master"

```

or add

```
"peterfriz/yii2-page-visibility": "dev-master"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

Enable the plugin in a view file:

```
use peterfriz\pagevisibility\PageVisibilityAsset;
PageVisibilityAsset::register($this);

```

React on visibilty changes in js:

```
pageVisibility.init(
    function() {
        console.log('visible');
    },
    function() {
        console.log('hidden');
    }
);

```

License
-------

[](#license)

**yii2-page-visibility** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18538733?v=4)[peterfriz](/maintainers/peterfriz)[@peterfriz](https://github.com/peterfriz)

---

Top Contributors

[![peterfriz](https://avatars.githubusercontent.com/u/18538733?v=4)](https://github.com/peterfriz "peterfriz (6 commits)")

### Embed Badge

![Health badge](/badges/peterfriz-yii2-page-visibility/health.svg)

```
[![Health](https://phpackages.com/badges/peterfriz-yii2-page-visibility/health.svg)](https://phpackages.com/packages/peterfriz-yii2-page-visibility)
```

###  Alternatives

[alexpechkarev/geometry-library

PHP Geometry library provides utility functions for the computation of geometric data on the surface of the Earth.

1393.9M6](/packages/alexpechkarev-geometry-library)[bllim/datatables

Server-side handler of DataTables Jquery Plugin for Laravel 4

260416.5k4](/packages/bllim-datatables)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
