更新 Safari 扩展程序?

发布于 2024-09-05 18:01:24 字数 1505 浏览 7 评论 0原文

我正在编写一个简单的 Safari 扩展,并且正在尝试找出如何让更新机制正常工作。 Apple 的文档在这里非常模糊:

https:// /developer.apple.com/library/archive/documentation/Tools/Conceptual/SafariExtensionGuide/UpdatingExtensions/UpdatingExtensions.html

这是我的清单,基于该文档:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Extension Updates</key>
    <array>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>net.rickyromero.safari.shutup</string>
            <key>Team Identifier</key>
            <string>TMM5P68287</string>
            <key>CFBundleVersion</key>
            <string>1</string>
            <key>CFBundleShortVersionString</key>
            <string>1.0</string>
            <key>URL</key>
            <string>http://rickyromero.net/misc/SafariExtensions/ShutUp.safariextz</string>
        </dict>
    </array>
</dict>
</plist>

我不知道从哪里获取“YourCertifcateID”,例如。当我增加 CFBundleVersion 和 CFBundleShortVersionString 的值时,它不会触发更新。不过,我知道 Safari 正在访问我的清单,因为我正在观察 HTTP 流量。

I'm writing a simple Safari Extension, and I'm trying to figure out how to get the update mechanism working. Apple's documentation here is delightfully vague:

https://developer.apple.com/library/archive/documentation/Tools/Conceptual/SafariExtensionGuide/UpdatingExtensions/UpdatingExtensions.html

And here's my manifest, based on that documentation:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Extension Updates</key>
    <array>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>net.rickyromero.safari.shutup</string>
            <key>Team Identifier</key>
            <string>TMM5P68287</string>
            <key>CFBundleVersion</key>
            <string>1</string>
            <key>CFBundleShortVersionString</key>
            <string>1.0</string>
            <key>URL</key>
            <string>http://rickyromero.net/misc/SafariExtensions/ShutUp.safariextz</string>
        </dict>
    </array>
</dict>
</plist>

I don't know where to get "YourCertifcateID," for example. And when I increment the values for CFBundleVersion and CFBundleShortVersionString, it doesn't trigger an update. I know Safari is hitting my manifest though, because I'm watching HTTP traffic.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

泪眸﹌ 2024-09-12 18:01:24

团队标识符应为开发人员标识符

开发人员标识符取自扩展生成器窗口顶部的字符串,Safari Developer: (DEVELOPER_IDENTIFIER) EMAIL

Team Identifier should be Developer Identifier

The Developer Identifier is taken from the string at the top of the Extension Builder window, Safari Developer: (DEVELOPER_IDENTIFIER) EMAIL

我要还你自由 2024-09-12 18:01:24

类似的问题。 Safari 会看到更新(我已将更新设置为手动),但在检测到更新时单击安装按钮不会执行任何操作。如果我随后选中“自动安装更新”,则更新过程将开始并完成,但不会安装新版本。我可以看到网络服务器的流量,因此我知道已发出请求。

编辑:
固定的!存储扩展程序的 Web 目录权限错误,修复了此问题并手动和自动安装。每次我重建扩展并保存到我的网络服务文件夹时,我都必须设置权限。

第二次编辑:
如果您想查看现有扩展,请下载它或从 Safari 扩展文件夹中获取它,然后将 .safariextz 更改为 .xar,然后使用 Pacifist 打开/解压以查看代码,如果您想将其添加到扩展生成器应用程序中。

Similar issue. Safari sees the update (I have set updates to manual) but clicking the install button when an update is detected does nothing. If I then check the "Install Updates Automatically" the update process begins and completes but the new version is not installed. I can see the traffic to the webserver so I know a request has been made.

EDIT:
Fixed! Permissions were wrong on the web directory where the extension was stored, fixed this and it installed manually and automatically. Everytime I rebuild the extension and save to my web serving folder I have to set the permissions.

2nd Edit:
If you want to look at an existing extension, download it or get it from your Safari extensions folder then change the .safariextz to .xar then open/extract with Pacifist to view the code and if you want add it to the Extension Builder app.

携君以终年 2024-09-12 18:01:24

我遇到了同样的问题,PLIST 文件与上面的文件类似,这是我解决问题的方法:

  • 开发人员标识符不正确(有 5 而不是 Z)。呃!
  • 权限,每次更新文件时都会休息:

    chmod 0444 EXTENSIONNAME.safariextz

I had the same problem, the PLIST file was like the one above and here is how I resolved my problem:

  • Had an incorrect Developer Identifier (had a 5 instead of a Z). Duh!
  • Permissions, which are rest every time you update the file:

    chmod 0444 EXTENSIONNAME.safariextz

懷念過去 2024-09-12 18:01:24

刚刚遇到了同样的问题,权限对我来说也是问题。 .safariextz 文件通过我主页上的直接链接下载得很好,但我必须在服务器上将其权限设置为 a+x,然后 Safari 才能将其作为自动更新下载。

Just had the same problem, and permissions were the issue for me, too. The .safariextz file downloaded fine via a direct link on my homepage, but I had to set its permissions to a+x on the server before Safari would download it as an automatic update.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文