Checking user's homepage in Internet Explorer

前端 未结 3 1685
眼角桃花
眼角桃花 2021-01-30 07:49

Google displays a popup that asks if you want to set your home page as google.com. It\'s quite normal, when I say OK it sets it as google.com. After that however, I don\'t get t

3条回答
  •  一生所求
    2021-01-30 08:41

    The code Google uses can be viewed here:

    google.promos.mgmhp.isGoogleHomepage = function (a) {
        var b = !1;
        try {
            b = window.external.isGoogleHomePage()
        } catch (d) {
            if (h(a)) return !0;
            var c = google.promos.gpd(a, "mgmhp_hp_url");
            c && g.push(c);
            for (c = 0; c < g.length; c++) {
                var k = g[c];
                if (b = b || a.isHomePage(k)) return !0
            }
        }
        return b
    };
    

    They are using the proprietary isHomePage method to check if google.com is your homepage. More info here.

提交回复
热议问题