为什么我的Greasemonkey脚本没有更新? [英] Why isn't my Greasemonkey script updating?

查看:129
本文介绍了为什么我的Greasemonkey脚本没有更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于Firefox的Greasemonkey脚本.该脚本包括此元块和一些代码行.

I've got a Greasemonkey script for Firefox. The script includes this meta-block and some lines of code.

我想更新服务器上的脚本,然后自动更新浏览器的脚本. requireSecureUpdates选项已关闭.
我在做什么错了?

I want to update my script on the server and then automatically update the browser's scripts. The requireSecureUpdates option is off.
What am I doing wrong?

我的1.meta.js

My 1.meta.js

// ==UserScript== 
// @name     Ibood autosubmit 
// @include  https://*.ibood.com/* 
// @include  http://*.ibood.com/* 
// @include  * 
// @version  1.1 
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js 
// @grant    GM_addStyle 
// @downloadURL http://www.tipsvoorbesparen.nl/1.user.js
// @updateURL http://www.tipsvoorbesparen.nl/1.meta.js
// ==/UserScript== 

推荐答案

两个问题:

  1. 当前,您的1.meta.js是:

    // ==UserScript== 
    // @name     Ibood autosubmit 
    // @include  https://*.ibood.com/* 
    // @include  http://*.ibood.com/* 
    // @include  * 
    // @version  1.7
    // @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js 
    // @grant    GM_addStyle 
    // @downloadURL http://www.tipsvoorbesparen.nl/1.user.js
    // @updateURL http://www.tipsvoorbesparen.nl/1.meta.js
    // ==/UserScript== 

注意前导空格吗?

由于设计限制 1 ,Greasemonkey无法为其元数据块处理前导空格. sup>.

Greasemonkey cannot handle leading spaces for its Metadata Block due to a design limitation1.

当前的脚本版本似乎是1.8,但是元文件的版本是1.7.

The current script version seems to be 1.8, but the meta file has version 1.7.

~~~~~
对于在您自己的网站上托管的小脚本,甚至不必理会@updateURL设置.在那里主要是为了节省带宽,尤其是在 userscripts.org 这样的网站上.

~~~~~
For small scripts, that you host on your own website, don't even bother with the @updateURL setting. That's there mainly to conserve bandwidth, especially on sites like userscripts.org.

在没有@updateURL设置的情况下,Greasemonkey将仅使用/检查@downloadURL设置的内容.这样可以节省您额外的维护工作(以及可能的SNAFU维护).

With no @updateURL setting, Greasemonkey will just use/check whatever's set by @downloadURL. This saves you extra maintenance work (and possible SNAFU's like this one).

最后,在不相关的地方,请不要使用@include *
使用@include *:

Finally, on an unrelated note, don't use @include *!
Using @include *:

  1. 放慢浏览器速度
  2. 可能会导致不良的副作用
  3. 导致有责任心的用户拒绝安装您的脚本.







1 .具体来说,这是GM源文件parseScript.js:

1. Specifically, this bit in the GM source file, parseScript.js:

var gAllMetaRegexp = new RegExp(
    '^// ==UserScript==([\\s\\S]*?)^// ==/UserScript==', 'm');

这篇关于为什么我的Greasemonkey脚本没有更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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