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

jquery-visibility

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-visibility - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

39

jquery-visibility.js

@@ -12,15 +12,29 @@ /*!

*/
;(function(window, document, $, undefined) {
;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], function ($) {
return factory(root, $);
});
} else if (typeof exports === 'object') {
// Node/CommonJS
module.exports = factory(root, require('jquery'));
} else {
// Browser globals
factory(root, jQuery);
}
}(this, function(window, $, undefined) {
"use strict";
var
document = window.document,
property, // property name of document, that stores page visibility
vendorPrefixes = ['webkit', 'o', 'ms', 'moz', ''],
$support = $.support || {},
// In Opera, `'onfocusin' in document == true`, hence the extra `hasFocus` check to detect IE-like behavior
eventName = 'onfocusin' in document && 'hasFocus' in document ?
'focusin focusout' :
'focus blur';
var prefix;
var property;
// In Opera, `'onfocusin' in document == true`, hence the extra `hasFocus` check to detect IE-like behavior
var eventName = 'onfocusin' in document && 'hasFocus' in document ?
'focusin focusout' :
'focus blur';
var prefixes = ['webkit', 'o', 'ms', 'moz', ''];
var $support = $.support;
var $event = $.event;
while ((prefix = prefixes.pop()) !== undefined) {

@@ -66,3 +80,3 @@ property = (prefix ? prefix + 'H': 'h') + 'idden';

) {
$event.trigger(
$(document).triggerHandler(
property && document[property] || /^(?:blur|focusout)$/.test(type) ?

@@ -76,3 +90,2 @@ 'hide' :

});
}(this, document, jQuery));
}));
/*! jquery-visibility v1.0.8 | MIT license | http://mths.be/visibility */
!function(i,t,e,o){"use strict";function n(){"hidden"!==u&&(t.hidden=f.pageVisibility?t[u]:o)}for(var s,u,r=("onfocusin"in t&&"hasFocus"in t?"focusin focusout":"focus blur"),c=["webkit","o","ms","moz",""],f=e.support,a=e.event;(s=c.pop())!==o;)if(u=(s?s+"H":"h")+"idden",f.pageVisibility=t[u]!==o,f.pageVisibility){r=s+"visibilitychange";break}n(),e(/blur$/.test(r)?i:t).on(r,function(i){var e=i.type,s=i.originalEvent;if(s){var r=s.toElement;(!/^focus./.test(e)||r===o&&s.fromElement===o&&s.relatedTarget===o)&&a.trigger(u&&t[u]||/^(?:blur|focusout)$/.test(e)?"hide":"show"),n()}})}(this,document,jQuery);
!function(e,i){"function"==typeof define&&define.amd?define(["jquery"],function(t){return i(e,t)}):"object"==typeof exports?module.exports=i(e,require("jquery")):i(e,jQuery)}(this,function(e,i,t){"use strict";function n(){"hidden"!==o&&(u.hidden=s.pageVisibility?u[o]:t)}for(var o,r,u=e.document,s=i.support||{},f=("onfocusin"in u&&"hasFocus"in u?"focusin focusout":"focus blur");(r=prefixes.pop())!==t;)if(o=(r?r+"H":"h")+"idden",s.pageVisibility=u[o]!==t,s.pageVisibility){f=r+"visibilitychange";break}n(),i(/blur$/.test(f)?e:u).on(f,function(e){var r=e.type,s=e.originalEvent;if(s){var f=s.toElement;(!/^focus./.test(r)||f===t&&s.fromElement===t&&s.relatedTarget===t)&&i(u).triggerHandler(o&&u[o]||/^(?:blur|focusout)$/.test(r)?"hide":"show"),n()}})});
{
"name": "jquery-visibility",
"version": "1.0.8",
"version": "1.0.9",
"description": "Page visibility shim for jQuery.",

@@ -34,2 +34,5 @@ "keywords": [

},
"dependencies": {
"jquery": "*"
},
"devDependencies": {

@@ -36,0 +39,0 @@ "gulp": "^3.8.11",

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