简体   繁体   English

在Safari 8 OSX 10.10上以编程方式安装扩展

[英]Programmatically install extensions on Safari 8 OSX 10.10

I'm trying to fix a couple of bugs for SafariDriver/Selenium. 我正在尝试修复SafariDriver / Selenium的一些错误。

Here is the problem: 这是问题所在:

On Safari 7 and bellow, to install a new plug in all you had to do is put the extension into ~/Library/Safari/Extensions. 在Safari 7和以下版本中,要安装新插件,只需将扩展程序放入〜/ Library / Safari / Extensions中即可。 Next all you have to do is activate the plugin by adding it to the ~/Library/Safari/Extensions/Extensions.plist after this the Safari will have the plugin installed. 接下来,您要做的就是通过将插件添加到〜/ Library / Safari / Extensions / Extensions.plist来激活该插件,然后Safari将安装该插件。

Starting with 10.10, this is no longer possible to do. 从10.10开始,将不再可能这样做。 The location of the extension is the same but i'm not sure how to activate the extension, since the Extensions.plist no longer exists. 扩展程序的位置相同,但是我不确定如何激活扩展程序,因为Extensions.plist不再存在。

My understanding is that there is some file that is controlled via "Safari Extensions List" password in the keychain under login but I have no idea which file this may apply to. 我的理解是,登录时在钥匙串中有一些文件是通过“ Safari扩展列表”密码控制的,但我不知道该文件可能适用于哪个文件。

If I compile and install the extention by hand, everything works just fine but the automatic installation of the latest plugin is broken. 如果我手动编译并安装扩展,则一切正常,但最新插件的自动安装已中断。 (documentation for this https://code.google.com/p/selenium/wiki/SafariDriverInternals ) (此https://code.google.com/p/selenium/wiki/SafariDriverInternals的文档)

"Safari Extensions List" password is not password actually but a binary plist same as ~/Library/Safari/Extensions/Extensions.plist “ Safari扩展列表”密码实际上不是密码,而是与~/Library/Safari/Extensions/Extensions.plist相同的二进制plist

Read it, modify it, write it back. 读取,修改,写回。

The correct thing to do is to have the user install the extension by opening it manually (double-click or command o). 正确的做法是让用户通过手动打开扩展程序来安装扩展程序(双击或命令o)。 That's what Apple is trying to get you to do. 这就是Apple试图让您做的。 Apple never really wanted anybody messing about with plists for other apps. 苹果公司从不真正希望任何人为其他应用程序而烦恼。

Most preferences plists are cached in memory anyway and would require a new login session to blow them away and get new copies. 无论如何,大多数首选项都将缓存在内存中,并且需要新的登录会话才能删除它们并获取新副本。 plists are updated on ending the session or the app in question. 会在结束会话或有问题的应用程序时更新。

They were never intended as a means to modify another app's behavior. 从来没有将它们用作修改其他应用程序行为的手段。 That is a security risk. 那是安全隐患。

In the case of Selenium, the intent is clearly to create an automated test environment. 对于Selenium,显然是要创建一个自动化测试环境。 Setting up a nice installer pre-empts that to some degree. 设置一个不错的安装程序可以在某种程度上抢占先机。

The right thing to do is to file a bug with Apple letting them know what kind of functionality you need in Safari. 正确的做法是向Apple提交错误,让他们知道Safari需要什么样的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM