doubanIMDb icon indicating copy to clipboard operation
doubanIMDb copied to clipboard

增加Safari支持

Open lisongx opened this issue 4 years ago • 4 comments

lisongx avatar Jun 10 '20 21:06 lisongx

safari 不再支持 .safariextz 格式的 legacy extensions 了, 现在似乎需要先在 Xcode 里面 build 一个 macOS app, 然后在 app 里面加 一个 safari app extension target.

lleiou avatar Jun 13 '20 12:06 lleiou

@lleiou 所以开发起来还是挺麻烦的?觉得主要似乎是safari不支持 WebExtensions api, 所以代码不是很方便复用。 https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions

看来是需要safari单独开发了!

lisongx avatar Jun 14 '20 13:06 lisongx

@lisongx

对的, 不能直接使用, 需要改一改. Xcode 里面有专门做 safari app extension 的选项, 应该可以把改好的 .js 代码放到里面.

在 github 上找到了一个 safari app extension 的 repo, 大概做出来就是这样: lautis/refined-github-safari

lleiou avatar Jun 14 '20 23:06 lleiou

@lleiou 所以开发起来还是挺麻烦的?觉得主要似乎是safari不支持 WebExtensions api, 所以代码不是很方便复用。 https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions

看来是需要safari单独开发了!

周二 (2020-06-23) 好像会有一个 wwdc online session 来介绍 safari-web-extension-converter tool, 准备到时候看一下. 如果这个工具好用的话, 提供 safari support 会容易许多:

"We'll show you how to build a new Safari Web Extension and host it on the App Store, as well as how to use the safari-web-extension-converter tool to migrate existing extensions from other web browsers like Chrome, Firefox, or Edge with very little effort."

lleiou avatar Jun 23 '20 02:06 lleiou