Detect if Safari Extension is Installed

前端 未结 2 1645
陌清茗
陌清茗 2020-12-21 11:49

Is there a way through JavaScript to detect if a Safari Extension is already installed? https://extensions.apple.com has some way of doing it because they update the install

2条回答
  •  爱一瞬间的悲伤
    2020-12-21 12:22

    To detect your extension server-side, the easiest way is to inject a session cookie in your domain with a content script.

    In Chrome and Firefox, you could inject an HTTP Header, but the API in Safari does not allow it.

    The problem with cookies: if your user uninstall the extension, you will notice only when his session ends (closing browser).

提交回复
热议问题