以编程方式访问macOS Mojave中的Safari书签 [英] Access safari bookmarks in macOS Mojave programmatically

查看:68
本文介绍了以编程方式访问macOS Mojave中的Safari书签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从升级到macOS Mojave以来,我发现用户访问~/Library/Safari/Bookmarks.plist受到权限限制.那么,有没有其他方法可以通过编程方式做到这一点呢?是否有SafariKit或我可以用来将书签导入到我自己的程序中的东西?我尝试在线搜索,但没有人提及此事.如果你们知道,请帮助我.谢谢

Since upgraded to macOS Mojave, I find there are permission restrictions to user from accessing ~/Library/Safari/Bookmarks.plist. So is there an alternative way to do it programmatically? Is there a SafariKit or something I can use to import bookmarks to my own program? I tried to search online, but no one mentions anything about it. If you guys know, please help me. Thank you

推荐答案

由于Mojave中更严格的安全规则,您无法再访问〜/Library/Safari/Bookmarks.plist.

You cannot access ~/Library/Safari/Bookmarks.plist anymore because of the stricter security rules in Mojave.

我认为还没有API可以执行此特定操作,因此目前的解决方案是将应用程序自己添加到System Preferences > Security > Confidentiality > Disk access.

I don't think there's an API to do this specific action yet, so the solution for now is to add the application yourself to System Preferences > Security > Confidentiality > Disk access.

例如,如果您将Terminal.app添加到机密性"子组中,这将向在Terminal中执行的所有命令授予对整个磁盘的访问权限,包括使用cat/vim/...访问〜/Library/Safari/Bookmarks. plist.

For example if you add Terminal.app to this Confidentiality subgroup, this will grant access to the whole disk to all commands executed in Terminal, inluding using cat/vim/... to access ~/Library/Safari/Bookmarks.plist.

这篇关于以编程方式访问macOS Mojave中的Safari书签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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