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

@yorkjs/web-page

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yorkjs/web-page - npm Package Compare versions

Comparing version 0.0.9 to 0.1.0

10

dist/web-page.esm.js
/**
* web-page.js v0.0.9
* web-page.js v0.1.0
* (c) 2021-2022 musicode

@@ -12,3 +12,3 @@ * Released under the MIT License.

let isPageAlive = false;
let isPageAlive = undefined;
let isPageFrozen = false;

@@ -50,3 +50,3 @@ let visible;

events[type] = data;
if (isPageAlive && !isPageFrozen) {
if (isPageAlive !== false && !isPageFrozen) {
fireEventData(type, data);

@@ -101,3 +101,3 @@ }

const onPageLeave = debounceListener(function (event) {
if (!isPageAlive) {
if (isPageAlive === false) {
return;

@@ -162,5 +162,5 @@ }

*/
const version = "0.0.9";
const version = "0.1.0";
export { ENTER, HIDE, LEAVE, SHOW, addEventListener, init, version };
//# sourceMappingURL=web-page.esm.js.map

@@ -1,2 +0,2 @@

const n="show",e="hide",t="enter",i="leave";let o,c,u=!1,d=!1;const s={},f={};function r(n,e){return`on${e}`in n}function a(n,e,t){n.addEventListener?n.addEventListener(e,t,!0):n.attachEvent&&n.attachEvent("on"+e,t)}function h(n,e){let t;return function(){t||(n(arguments[0]),t=setTimeout((function(){t=void 0}),e))}}function l(n,e){const t={event:e,visible:o,persisted:c};s[n]=t,u&&!d&&w(n,t)}function w(n,e){const t=f[n];if(t)for(let n=0,i=t.length;n<i;n++)t[n]&&t[n](e)}function v(){const n=document.visibilityState;o="visible"===n||"hidden"!==n&&void 0}const m=h((function(n){u||(u=!0,l("enter",n))}),200),p=h((function(n){u&&(l("leave",n),u=!1)}),200);function g(){}function b(n,e){const t=f[n]||(f[n]=[]);return t.push(e),"enter"===n&&s[n]&&w(n,s[n]),{remove(){for(let n=0,i=t.length;n<i;n++)t[n]===e&&t.splice(n,1)}}}v(),r(document,"visibilitychange")&&a(document,"visibilitychange",(function(n){v(),!0===o?l("show",n):!1===o&&l("hide",n)})),r(document,"freeze")&&a(document,"freeze",(function(){d=!0})),r(document,"resume")&&a(document,"resume",(function(){d=!1})),r(window,"pageshow")?a(window,"pageshow",(function(n){c=n.persisted,m(n)})):a(window,"load",m),r(window,"pagehide")&&a(window,"pagehide",(function(n){c=n.persisted,p(n)})),a(window,"beforeunload",p);const E="0.0.9";export{t as ENTER,e as HIDE,i as LEAVE,n as SHOW,b as addEventListener,g as init,E as version};
const n="show",e="hide",t="enter",i="leave";let o,c,u,d=!1;const s={},f={};function r(n,e){return`on${e}`in n}function a(n,e,t){n.addEventListener?n.addEventListener(e,t,!0):n.attachEvent&&n.attachEvent("on"+e,t)}function h(n,e){let t;return function(){t||(n(arguments[0]),t=setTimeout((function(){t=void 0}),e))}}function l(n,e){const t={event:e,visible:c,persisted:u};s[n]=t,!1===o||d||w(n,t)}function w(n,e){const t=f[n];if(t)for(let n=0,i=t.length;n<i;n++)t[n]&&t[n](e)}function v(){const n=document.visibilityState;c="visible"===n||"hidden"!==n&&void 0}const m=h((function(n){o||(o=!0,l("enter",n))}),200),p=h((function(n){!1!==o&&(l("leave",n),o=!1)}),200);function g(){}function b(n,e){const t=f[n]||(f[n]=[]);return t.push(e),"enter"===n&&s[n]&&w(n,s[n]),{remove(){for(let n=0,i=t.length;n<i;n++)t[n]===e&&t.splice(n,1)}}}v(),r(document,"visibilitychange")&&a(document,"visibilitychange",(function(n){v(),!0===c?l("show",n):!1===c&&l("hide",n)})),r(document,"freeze")&&a(document,"freeze",(function(){d=!0})),r(document,"resume")&&a(document,"resume",(function(){d=!1})),r(window,"pageshow")?a(window,"pageshow",(function(n){u=n.persisted,m(n)})):a(window,"load",m),r(window,"pagehide")&&a(window,"pagehide",(function(n){u=n.persisted,p(n)})),a(window,"beforeunload",p);const E="0.1.0";export{t as ENTER,e as HIDE,i as LEAVE,n as SHOW,b as addEventListener,g as init,E as version};
//# sourceMappingURL=web-page.esm.min.js.map
/**
* web-page.js v0.0.9
* web-page.js v0.1.0
* (c) 2021-2022 musicode

@@ -18,3 +18,3 @@ * Released under the MIT License.

var isPageAlive = false;
var isPageAlive = undefined;
var isPageFrozen = false;

@@ -56,3 +56,3 @@ var visible;

events[type] = data;
if (isPageAlive && !isPageFrozen) {
if (isPageAlive !== false && !isPageFrozen) {
fireEventData(type, data);

@@ -107,3 +107,3 @@ }

var onPageLeave = debounceListener(function (event) {
if (!isPageAlive) {
if (isPageAlive === false) {
return;

@@ -168,3 +168,3 @@ }

*/
var version = "0.0.9";
var version = "0.1.0";

@@ -171,0 +171,0 @@ exports.ENTER = ENTER;

@@ -1,2 +0,2 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).WebPage={})}(this,(function(e){"use strict";var n,i,t="show",o="hide",d="enter",u="leave",f=!1,r=!1,c={},s={};function a(e,n){return"on"+n in e}function v(e,n,i){e.addEventListener?e.addEventListener(n,i,!0):e.attachEvent&&e.attachEvent("on"+n,i)}function l(e,n){var i;return function(){i||(e(arguments[0]),i=setTimeout((function(){i=void 0}),n))}}function h(e,t){var o={event:t,visible:n,persisted:i};c[e]=o,f&&!r&&p(e,o)}function p(e,n){var i=s[e];if(i)for(var t=0,o=i.length;t<o;t++)i[t]&&i[t](n)}function w(){var e=document.visibilityState;n="visible"===e||"hidden"!==e&&void 0}var m=l((function(e){f||(f=!0,h(d,e))}),200),b=l((function(e){f&&(h(u,e),f=!1)}),200);w(),a(document,"visibilitychange")&&v(document,"visibilitychange",(function(e){w(),!0===n?h(t,e):!1===n&&h(o,e)})),a(document,"freeze")&&v(document,"freeze",(function(){r=!0})),a(document,"resume")&&v(document,"resume",(function(){r=!1})),a(window,"pageshow")?v(window,"pageshow",(function(e){i=e.persisted,m(e)})):v(window,"load",m),a(window,"pagehide")&&v(window,"pagehide",(function(e){i=e.persisted,b(e)})),v(window,"beforeunload",b);e.ENTER=d,e.HIDE=o,e.LEAVE=u,e.SHOW=t,e.addEventListener=function(e,n){var i=s[e]||(s[e]=[]);return i.push(n),e===d&&c[e]&&p(e,c[e]),{remove:function(){for(var e=0,t=i.length;e<t;e++)i[e]===n&&i.splice(e,1)}}},e.init=function(){},e.version="0.0.9",Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).WebPage={})}(this,(function(e){"use strict";var n,i,t="show",o="hide",d="enter",u="leave",f=void 0,r=!1,c={},s={};function a(e,n){return"on"+n in e}function v(e,n,i){e.addEventListener?e.addEventListener(n,i,!0):e.attachEvent&&e.attachEvent("on"+n,i)}function l(e,n){var i;return function(){i||(e(arguments[0]),i=setTimeout((function(){i=void 0}),n))}}function h(e,t){var o={event:t,visible:n,persisted:i};c[e]=o,!1===f||r||p(e,o)}function p(e,n){var i=s[e];if(i)for(var t=0,o=i.length;t<o;t++)i[t]&&i[t](n)}function w(){var e=document.visibilityState;n="visible"===e||"hidden"!==e&&void 0}var m=l((function(e){f||(f=!0,h(d,e))}),200),b=l((function(e){!1!==f&&(h(u,e),f=!1)}),200);w(),a(document,"visibilitychange")&&v(document,"visibilitychange",(function(e){w(),!0===n?h(t,e):!1===n&&h(o,e)})),a(document,"freeze")&&v(document,"freeze",(function(){r=!0})),a(document,"resume")&&v(document,"resume",(function(){r=!1})),a(window,"pageshow")?v(window,"pageshow",(function(e){i=e.persisted,m(e)})):v(window,"load",m),a(window,"pagehide")&&v(window,"pagehide",(function(e){i=e.persisted,b(e)})),v(window,"beforeunload",b);e.ENTER=d,e.HIDE=o,e.LEAVE=u,e.SHOW=t,e.addEventListener=function(e,n){var i=s[e]||(s[e]=[]);return i.push(n),e===d&&c[e]&&p(e,c[e]),{remove:function(){for(var e=0,t=i.length;e<t;e++)i[e]===n&&i.splice(e,1)}}},e.init=function(){},e.version="0.1.0",Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=web-page.min.js.map
{
"name": "@yorkjs/web-page",
"version": "0.0.9",
"version": "0.1.0",
"description": "web page life cycle",

@@ -5,0 +5,0 @@ "main": "dist/web-page.js",

@@ -6,2 +6,2 @@ export { SHOW, HIDE, ENTER, LEAVE, } from './constant';

*/
export declare const version = "0.0.9";
export declare const version = "0.1.0";
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