Skip to content

Instantly share code, notes, and snippets.

@KiChjang
Created November 22, 2016 18:57
Show Gist options
  • Save KiChjang/1d7b3bfa160d1fb4720c3523dfee3f09 to your computer and use it in GitHub Desktop.
Save KiChjang/1d7b3bfa160d1fb4720c3523dfee3f09 to your computer and use it in GitHub Desktop.
Google maps function
efa = function() {
var a = _.k.MessageChannel;
"undefined" === typeof a && "undefined" !== typeof window && window.postMessage && window.addEventListener && !_.kc("Presto") && (a = function() {
var a = window.document.createElement(_.Vea);
a.style.display = _.Wa;
a.src = "";
window.document.documentElement.appendChild(a);
var b = a.contentWindow,
a = b.document;
a.open();
a.write("");
a.close();
var c = "callImmediate" + Math.random(),
d = "file:" == b.location.protocol ? "*" : b.location.protocol + "//" + b.location.host,
a = (0, _.m)(function(a) {
if (("*" == d ||
a.origin == d) && a.data == c) this.port1.onmessage()
}, this);
b.addEventListener(_.Ua, a, !1);
this.port1 = {};
this.port2 = {
postMessage: function() {
b.postMessage(c, d)
}
}
});
if ("undefined" !== typeof a && !_.mc()) {
var b = new a,
c = {},
d = c;
b.port1.onmessage = function() {
if (_.oa(c.next)) {
c = c.next;
var a = c.cb;
c.cb = null;
a()
}
};
return function(a) {
d.next = {
cb: a
};
d = d.next;
b.port2.postMessage(0)
}
}
return "undefined" !== typeof window.document && "onreadystatechange" in window.document.createElement(_.Wea) ? function(a) {
var b = window.document.createElement(_.Wea);
b.onreadystatechange = function() {
b.onreadystatechange = null;
b.parentNode.removeChild(b);
b = null;
a();
a = null
};
window.document.documentElement.appendChild(b)
} : function(a) {
_.k.setTimeout(a, 0)
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment