Answer the question
In order to leave comments, you need to log in
What does this piece of code (JS) do?
(function(){var a=function(){this.exit=this.b;this.close=this.close;this.delayCloseButton=this.a};a.prototype.b=function(){window.console&&window.console.log("Exit API: Close requested.")};a.prototype.a=function(e){e=Math.min(e,5);window.console&&window.console.log("Exit API: Close Button will not appear for "+e+" seconds.")};var b=new a,c=["ExitApi"],d=this;
c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var f;c.length&&(f=c.shift());)c.length||void 0===b?d=d[f]&&d[f]!==Object.prototype[f]?d[f]:d[f]={}:d[f]=b;}).call(this);
Answer the question
In order to leave comments, you need to log in
The question is far from simple. If we run it through jsbeautifier.org and remove the noise, then the following code remains:
(function(){
function ExitApi () {};
ExitApi.prototype.exit = function() {
console.log("Exit API: Close requested.")
};
ExitApi.prototype.delayCloseButton = function(e) {
if (e < 5) e = 5;
console.log("Exit API: Close Button will not appear for " + e + " seconds.")
};
var b = new ExitApi(),
method = "ExitApi",
_this = this;
if (!method in _this && _this.execScript) {
_this.execScript("var " + method);
}
if (!_this[method] || _this[method] === Object.prototype[method]) _this[method] = ExitApi;
}).call(this);
(function(){
function Foo () {};
Foo.prototype.exit = function() {
console.log("Exit API: Close requested.")
};
Foo.prototype.delayCloseButton = function(e) {
if (e < 5) e = 5;
console.log("Exit API: Close Button will not appear for " + e + " seconds.")
};
this.ExitApi = new Foo();
}).call(this);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question