Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastkit/visibility

Package Overview
Dependencies
Maintainers
1
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastkit/visibility - npm Package Compare versions

Comparing version 0.6.10 to 0.6.11

34

dist/visibility.cjs.js

@@ -5,5 +5,32 @@ 'use strict';

var helpers = require('@fastkit/helpers');
let _hidden = 'hidden';
let _visibilityChange = 'visibilitychange';
if (helpers.IN_WINDOW) {
if (document.hidden !== undefined) {
_hidden = 'hidden';
_visibilityChange = 'visibilitychange';
}
else if (document.mozHidden !== undefined) {
_hidden = 'mozHidden';
_visibilityChange = 'mozvisibilitychange';
}
else if (document.msHidden !== undefined) {
_hidden = 'msHidden';
_visibilityChange = 'msvisibilitychange';
}
else if (document.webkitHidden !== undefined) {
_hidden = 'webkitHidden';
_visibilityChange = 'webkitvisibilitychange';
}
}
const HIDDEN = _hidden;
const VISIBILITY_CHANGE = _visibilityChange;
const states = ['visible', 'hidden'];
function getVisibilityState() {
return 'hidden';
if (!helpers.IN_WINDOW)
return 'hidden';
return document[HIDDEN] ? 'hidden' : 'visible';
}

@@ -27,2 +54,7 @@ class VisibilityManager {

constructor() {
if (helpers.IN_WINDOW) {
document.addEventListener(VISIBILITY_CHANGE, (e) => {
this._setState(getVisibilityState(), e);
}, false);
}
}

@@ -29,0 +61,0 @@ _setState(state, event) {

@@ -5,5 +5,32 @@ 'use strict';

var helpers = require('@fastkit/helpers');
let _hidden = 'hidden';
let _visibilityChange = 'visibilitychange';
if (helpers.IN_WINDOW) {
if (document.hidden !== undefined) {
_hidden = 'hidden';
_visibilityChange = 'visibilitychange';
}
else if (document.mozHidden !== undefined) {
_hidden = 'mozHidden';
_visibilityChange = 'mozvisibilitychange';
}
else if (document.msHidden !== undefined) {
_hidden = 'msHidden';
_visibilityChange = 'msvisibilitychange';
}
else if (document.webkitHidden !== undefined) {
_hidden = 'webkitHidden';
_visibilityChange = 'webkitvisibilitychange';
}
}
const HIDDEN = _hidden;
const VISIBILITY_CHANGE = _visibilityChange;
const states = ['visible', 'hidden'];
function getVisibilityState() {
return 'hidden';
if (!helpers.IN_WINDOW)
return 'hidden';
return document[HIDDEN] ? 'hidden' : 'visible';
}

@@ -27,2 +54,7 @@ class VisibilityManager {

constructor() {
if (helpers.IN_WINDOW) {
document.addEventListener(VISIBILITY_CHANGE, (e) => {
this._setState(getVisibilityState(), e);
}, false);
}
}

@@ -29,0 +61,0 @@ _setState(state, event) {

8

dist/visibility.esm-bundler.js

@@ -0,4 +1,6 @@

import { IN_WINDOW } from '@fastkit/helpers';
let _hidden = 'hidden';
let _visibilityChange = 'visibilitychange';
if ((typeof document !== 'undefined')) {
if (IN_WINDOW) {
if (document.hidden !== undefined) {

@@ -26,3 +28,3 @@ _hidden = 'hidden';

function getVisibilityState() {
if (!(typeof document !== 'undefined'))
if (!IN_WINDOW)
return 'hidden';

@@ -48,3 +50,3 @@ return document[HIDDEN] ? 'hidden' : 'visible';

constructor() {
if ((typeof document !== 'undefined')) {
if (IN_WINDOW) {
document.addEventListener(VISIBILITY_CHANGE, (e) => {

@@ -51,0 +53,0 @@ this._setState(getVisibilityState(), e);

{
"name": "@fastkit/visibility",
"version": "0.6.10",
"version": "0.6.11",
"description": "@fastkit/visibility",

@@ -5,0 +5,0 @@ "buildOptions": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc