如何从私有域/github中进行用户cript自动更新?

发布于 2025-02-05 11:39:39 字数 437 浏览 3 评论 0 原文

我正在为TampermonKey开发一个用户订阅,并将其存储在属于我公司的Private Github上。我无法将代码上传到公共服务器上。脚本的自动更新功能似乎不起作用。

  1. TampermonKey使用自己的服务器检查更新吗?

  2. 是否可以从私有域中使用户cript自动更新?

我在用户文字中使用这些属性:

// @downloadURL  https://github02.private.domain/raw/github-username/repo-name/master/userscript.js
// @updateURL    https://github02.private.domain/raw/github-username/repo-name/master/userscript.js

I am developing a userscript for Tampermonkey and storing it on private Github, that belongs to my company. I can't upload the code on a public server. The auto update feature of the script doesn't seem to work.

  1. Is Tampermonkey using its own servers to check for updates?

  2. Is it possible to make userscript auto update itself from private domain?

I am using these properties in userscript:

// @downloadURL  https://github02.private.domain/raw/github-username/repo-name/master/userscript.js
// @updateURL    https://github02.private.domain/raw/github-username/repo-name/master/userscript.js

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

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

发布评论

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

评论(3

于我来说 2025-02-12 11:39:39

看起来自动更新实际上在一个私人域上工作,但是有2个问题:

  1. 我输入了错误的URL。在GitHub上打开RAW文件后,我复制了该链接,但是您需要从导致文件的原始版本的按钮中复制链接。该链接仅略有不同,因此一开始很难注意到。

不正确的URL: https:> https://github.com/raw/raw/username /Your-repo/main/script.user.js
正确的URL:

”“从raw

  1. 第二期是脚本文件名实际上需要以“ .user.js “(!),如上所述。我看不到任何地方提到的。每个人都在Stackoverflow上的示例中这样做,但是没人能解释这是一项要求!

It looks like the auto update actually works on a private domain, but there were 2 problems:

  1. I entered an incorrect URL. I copied the link AFTER opening the RAW file on GitHub, but you need to copy the link from the button that leads to the RAW version of the file. The link is only slightly different, so it was hard to notice at first.

Incorrect URL: https://github.com/raw/username/your-repo/main/script.user.js
Correct URL: https://github.com/username/your-repo/raw/main/script.user.js

Copy the link from RAW button

  1. Second issue is that the script file name actually needs to end with ".user.js" (!), like in example above. I don't see that mentioned anywhere. Everyone is doing it like this in examples on Stackoverflow, but no one explains, that this is a requirement!
め七分饶幸 2025-02-12 11:39:39

更好的是:您可以删除UpdateUrl并在存储库浏览器视图中打开 RAW 文件。 TampermonKey将检测到文件,并提供(重新)安装它。确保计算版本!

这是一个整洁的工作流程:

  • 在您选择的IDE中写下您的脚本
  • ,使用git工作流创建中央存储库
  • 打开 raw 文件,并在存储库

Tampermonkey中使用浏览器自动检查更新。

Even better: You can remove the updateURL and open the raw file in the repository browser view. Tampermonkey will detect the file and offers to (re)install it. Make sure the version is counted up!

Here is a neat workflow:

  • Write your script in the IDE of your choice
  • Use the git workflow creating a central repository
  • Open the raw file with your browser in the repository

Tampermonkey will check for updates there automatically.

鹤仙姿 2025-02-12 11:39:39

您可以在 github page 上提交您的USERSCRIPT。在您可以使用公共GitHub页面链接进行更新之后。

You can submit your userscript on Github Page. After you can use your public github page link for make update.

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