p2.ifengimg.com Open in urlscan Pro
2408:874c:1ff:22:38::a  Public Scan

URL: https://p2.ifengimg.com/a/2018/1011/callnewsApp1011v3.js
Submission: On January 24 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

(function() {
    var urlBak = location.href;
    var ua = navigator.userAgent;
    var uaMsg = {
        isWhere: function(reg) {
            return ua.match(reg)
        },
        weixin: ua.match(/MicroMessenger/gi),
        isWeibo: ua.match(/WeiBo/i),
        QQ: ua.match(/QQ\//),
        isAndroid: ua.match(/android/gi),
        isIos: ua.match(/iphone|ipod/gi),
        isIpad: ua.match(/ipad/gi),
        wxosEdition: function() {
            var reg = /([1-9]?[0-9])_([0-9])/gi;
            var iosarr = reg.exec(ua);
            if (iosarr != null && (this.isIos || this.isIpad) && iosarr.length >= 3) {
                return iosarr[1]
            } else {
                return 0
            }
        }
    };

    function platForm() {
        if (uaMsg.weixin) {
            return "wx"
        } else if (uaMsg.QQ) {
            return "qq"
        } else if (uaMsg.isWeibo) {
            return "weibo"
        } else {
            return "unknown"
        }
    }

    function oToS(p) {
        var arr = [];
        for (n in p) {
            if (n == "kind") {
                arr.push(n + "=" + platForm() + "|" + p[n])
            } else {
                arr.push(n + "=" + p[n])
            }
        }
        return arr.join("&")
    }

    function callNewsAPP(base, params) {
        var coldCall = document.createElement("img");
        coldCall.src = "http://api.iclient.ifeng.com/shareArticle?type=" + params.type + "&id=" + params.id;
        coldCall.id = "coldImg";
        coldCall.style.display = "none";
        document.body.appendChild(coldCall);
        setTimeout(function() {
                document.body.removeChild(coldCall)
            },
            500);
        var openPath = "wakeupiOS/" + (base.openPath || "ifengnews"),
            download = base.download || "http://a.app.qq.com/o/simple.jsp?pkgname=com.ifeng.news2&ckey=CK1367873683475",
            downloadAd = base.downloadAd || "",
            ucStopover = base.ucStopover || "http://p1.ifengimg.com/a/2017/callapp/ucStopover_v1.html?",
            protocolApi = base.protocolApi || "comifengnewsclient://call",
            domainApi = base.domainApi || "https://i.ifeng.com/",
            noDown;
        if (base.downloadAd && base.download) {
            noDown = true
        }
        var paramsPath = typeof params === "object" ? "?" + oToS(params) : "";
        if (uaMsg.isIos || uaMsg.isIpad) {
            if (ua.indexOf("QQBrowser") > 0) {
                var url = protocolApi + paramsPath
            } else {
                var url = domainApi + openPath + "/call" + paramsPath
                var urls = domainApi + openPath + "/call?remind=1&" + paramsPath
            }
            location.href = url
            setTimeout(function() {
                location.href = urls
            })
        } else {
            if (uaMsg.weixin || uaMsg.QQ || uaMsg.isWeibo) {
                var url = download + "&android_scheme=" + encodeURIComponent(protocolApi + paramsPath)
            } else if (ua.indexOf("UCBrowser") > 0 || ua.indexOf("U;") > 0) {
                var url = ucStopover + protocolApi + paramsPath
            } else {
                url = protocolApi + paramsPath
            }
            location.href = url;
            if (document.hasFocus() && noDown) {

                setTimeout(function() {
                        location.href = downloadAd
                    },
                    150)
            }
        }
    }
    window.callNewsAPP = callNewsAPP
})();