一键安装Safari扩展 [英] One Click install for Safari Extensions

查看:142
本文介绍了一键安装Safari扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,当用户下载Firefox插件时,下载完成后即开始安装插件.

When a user downloads a plugin firefox (for example) the plugin installation begins as soon as the download has completed.

是否可以在野生动物园中实现同一目标?也就是说,用户点击链接即可下载插件,下载后,插件会自动开始安装.

Is it possible to achieve the same thing in safari? i.e. user clicks link to download plugin, once it has downloaded it automatically begins the installation.

推荐答案

我认为除extensions.apple.com以外的任何其他域都无法做到这一点.

I don't think this is possible to do on any other domain except extensions.apple.com.

我对此进行了广泛的测试,并且只有在域匹配extensions.apple.com(可能由浏览器控制,类似于某些Chrome API仅显示在内部)的情况下,safari.installExtension()方法才存在.扩展本身).

I've done some extensive testing on this and the safari.installExtension() method is only present if the domain matches extensions.apple.com (probably controlled by the browser, similar to how certain Chrome APIs only shows up inside of extensions themselves).

我通过转到JS文件本身并打开JS控制台来测试此理论: https://extensions.apple.com/home/scripts/extensionInstall.js

I tested this theory by going to the JS file itself and opening the JS console: https://extensions.apple.com/home/scripts/extensionInstall.js

在加载该JS文件之后,在JS控制台中键入typeof(safari.installExtension),它应该返回"function".请注意,它存在于非HTML页面上,这意味着它是由浏览器提供的(因为该脚本不会执行,也没有提供该方法的代码).

After that JS file has loaded, type typeof(safari.installExtension) in the JS console and it should return "function". Notice that it exists on a non-HTML page, meaning it's being provided by the browser (since this script doesn't execute, nor has the code in it to provide this method).

我尝试在其他站点上执行此操作,但它不存在:"undefined".

I tried doing this on other sites and it doesn't exist: "undefined".

我也疯狂地认为它只需要扩展作为子域,所以我在 http://extensions上进行了测试. joomla.org 也没有骰子.我似乎找不到SSL的扩展子域.这可能行得通,但我对此表示严重怀疑,因为该方法似乎已受到监管,只能在Apple的特定扩展子域中显示.

I also had a crazy thought that it just needs extensions as the subdomain, so I tested it on http://extensions.joomla.org too, no dice. I can't seem to find an extensions sub-domain that's SSL though. That may work, but I seriously doubt it as the method appears to be regulated to only show up when on Apple's specific extensions sub-domain.

这篇关于一键安装Safari扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆