macos Safari插件开发
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1250912/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Safari plugin development
提问by yukas
I want to develop a Safari plugin using Xcode, and I want to access the bookmarks. What API should I use?
我想使用 Xcode 开发一个 Safari 插件,我想访问书签。我应该使用什么 API?
Since I'm asking, are there any tutorials out there for plugin development under Safari?
既然我在问,是否有任何关于 Safari 下插件开发的教程?
回答by
Safari plugins are well-supported, both for the Netscape-style NSAPI and the 'native' Cocoa plugins. There are dozens, if not hundreds, of official Safari plugins.
Safari 插件得到了很好的支持,包括 Netscape 风格的 NSAPI 和“原生”Cocoa 插件。有数十个(如果不是数百个)官方 Safari 插件。
However, not everything you might want to do is possible through plugins. I'm not clear if accessing bookmarks is possible.
但是,并非您想做的所有事情都可以通过插件实现。我不清楚是否可以访问书签。
There are lots of other docs on Safari plugins at the Safari Dev Center and Reference Library, including WebKit Plug-In Programming Topics.
Safari 开发中心和参考库中还有许多关于 Safari 插件的其他文档,包括 WebKit 插件编程主题。
回答by kiamlaluno
Safari 5 allows to create extensions in a similar way of what Google Chrome allows. See Safari Extensions Development Guide: About Safari Extensions.
Safari 5 允许以类似于 Google Chrome 允许的方式创建扩展。请参阅Safari 扩展开发指南:关于 Safari 扩展。
On Mac OS X Lion, the WebKit plug-in API is not compatible with the new process architecture adopted in Mac OS X Lion, and it is being deprecated. Plug-in developers currently using the WebKit plug-in API are recommended to adopt the Netscape plug-in API in order to be compatible with Safari on Mac OS X v10.7.
在 Mac OS X Lion 上,WebKit 插件 API 与 Mac OS X Lion 中采用的新进程架构不兼容,并且正在弃用。目前使用 WebKit 插件 API 的插件开发者建议采用 Netscape 插件 API,以便兼容 Mac OS X v10.7 上的 Safari。
回答by dlamblin
Since you want to write a plugin for Safari, you might also be interested in reading about developing plugins for webkit.
由于您想为 Safari 编写插件,您可能也有兴趣阅读有关为 webkit 开发插件的文章。
回答by Nick Dowell
There is no documented or Apple-supported way to create plug-ins for Safari.
没有记录或 Apple 支持的方式来为 Safari 创建插件。
That hasn't stopped many people creating add-ons, as you can see by browsing through Pimp My Safari.
这并没有阻止许多人创建附加组件,正如您通过浏览Pimp My Safari可以看到的。
Many of the plug-ins use SIMBLto load themselves into Safari, after which you can mess around with Safari's insides to do whatever you want. See the Armchair Guide To Cocoa Reverse Engineering.
许多插件使用SIMBL将自己加载到 Safari 中,之后您可以在 Safari 的内部乱搞以做您想做的任何事情。请参阅可可逆向工程扶手椅指南。
One thing is for sure—it won't be a walk in the park!
有一件事是肯定的——它不会是在公园里散步!
Good luck =]
祝你好运=]