V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
cuthead

Safari 是如何显示 weibo.com 里面的 Webpage Icon 和 Push Notifications 的

  •  
  •   cuthead · Feb 26, 2015 · 2589 views
    This topic created in 4084 days ago, the information mentioned may be changed or developed.

    正常情况下
    Webpage Icon要使用
    <link rel="apple-touch-icon" href="/custom_icon.png">
    Push Notifications要使用
    window.safari.pushNotification.requestPermission
    weibo.com都没使用,但Safari下这两项都工作,是什么原因?Safari内置微博的这个功能吗?

    4 replies    2015-02-26 12:20:49 +08:00
    yyfearth
        1
    yyfearth  
       Feb 26, 2015
    我觉得 Push Notifications 应该是系统支持 不是通过Safari
    OSX 你可以在 System Settings > Internet Accounts 里面登陆weibo
    iOS 也有这样支持
    然后系统就会接收通知了 不开Safari也可以用

    我不用weibo但是我用linkedIn 就是这样的
    cuthead
        2
    cuthead  
    OP
       Feb 26, 2015
    @yyfearth 我说的是Safari Push Notifications,在Safari - Preferences 下面有Notifications,是网站直接发Notifications,由Safari管理。这里有说明 https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/PushNotifications/PushNotifications.html#//apple_ref/doc/uid/TP40013225-CH3-SW1
    另外我发现block http://js2.t.sinajs.cn/t6/webim_prime/js/common/all.js?version=70309a0171c708d7 就能禁止显示这个,但我不懂Javascript,无法找到是哪段Javascript控制了弹出这个窗口

    这就是我说的Safari Push Notifications
    cuthead
        4
    cuthead  
    OP
       Feb 26, 2015
    @yyfearth 和这个类似,我在safari Inspect Element里搜了一下看起来像webkitNotifications,应该是Notification的一种
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2592 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 12:38 · PVG 20:38 · LAX 05:38 · JFK 08:38
    ♥ Do have faith in what you're doing.