Another Auto Update Script

By sizzlemctwizzle Last update Feb 11, 2011 — Installed 15,480 times.

Script is throwing an error in Error Console

in
Subscribe to Script is throwing an error in Error Console 11 posts, 5 voices



Kirk Goodwin Scriptwright
FirefoxWindows

I am just now seeing this in the error console.

Error: /\/\/\s*@version\s+(.*)\s*\n/i.exec(xpr.responseText).replace is not a function
Source File: file:///C:/Documents%20and%20Settings/goodwkw/Application%20Data/Mozilla/Firefox/Profiles/1lpzfyp9.default/extensions/%7Be4a8a97b-f2ed-450b-b12d-ee082ba24781%7D/components/greasemonkey.js
Line: 873

Was there an greasemonkey update that caused this or is there a conflict with another script out there?

Thanks!

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

That error would mean that the file on the server you are requesting does not have a @version set. Perhaps there is something wrong with the connection (either on your side or a "Page Not Found" on the server). Furthermore, that line of script has since been modified, meaning that you are not using the up-to-date version of my script so that error could already be fixed. Anyway, did you know you could do this now:

// ==UserScript==
// @name          PatentlyUseful for USPTO
// @namespace     kwgoodwin
// @description	  Provides helpful links for Issued Patents and Patent Applications at the United States Patent Office ( USPTO ).  Additional information available at PatentlyUseful.com.  
// @version       0.6.4
// @author        Kirk W Goodwin
// @copyright     2009, Kirk W Goodwin (http://www.patentlyuseful.com/)
// @require      http://sizzlemctwizzle.com/updater.php?id=45645
// @include       http://patft*.uspto.gov/netacgi/*
// @include       http://appft*.uspto.gov/netacgi/*
// ==/UserScript==
With just that line everything is taken care of automatically. You don't need to include the update code yourself or wrap your metadata. Just make sure to change your version number with every update. Future updates to my code will only be available at that url.

 
Jonathan Col... Scriptwright
FirefoxWindows

I think there is a bug in the code, actually.

exec(xpr.responseText) returns an array, which you cannot call replace() on. The script doesn't work unless I change the compare function to this:

this.xversion=/\/\/\s*@version\s+(.*)\s*\n/i.exec(xpr.responseText);
this.xname=/\/\/\s*@name\s+(.*)\s*\n/i.exec(xpr.responseText);
if ( (this.xversion) && (this.xname[1] == this.name) ) {
this.xversion = this.xversion[1].replace(/\./g, '');
this.xname = this.xname[1];
}

That fix seems to be made on the http://sizzlemctwizzle.com/updater.php script but not on the userscripts.org script.

 
Jonathan Col... Scriptwright
FirefoxWindows

Scratch that. The source code for the script itself is correct, but the "How to use?" section of the documentation isn't up to date.

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

Jon Collins wrote:
Scratch that. The source code for the script itself is correct, but the "How to use?" section of the documentation isn't up to date.

My bad man. I forgot to update that. Anyway I've finally updated the version hosted here if you prefer pasting the code in your script.

 
Jonathan Col... Scriptwright
FirefoxWindows

I'm actually using the @require method now as it is much cleaner, but I was trying to paste the code itself to test and fiddle. Got it all figured out now though! Thanks.

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

Jon Collins wrote:
I'm actually using the @require method now as it is much cleaner

Yeah it is. I prefer it myself.
Jon Collins wrote:
Got it all figured out now though! Thanks.

Glad you got it working.

 
Bouvere Scriptwright
FirefoxWindows

The Updater using the @require method is not working for me, i think it cant work for anyone..
The version defined on the page I load using the @require url is always the latest version number, and the version you load from the meta file (https://userscripts.org/scripts/source/38017.me...) is the latest version number too! The script compares the latest version number to the latest version number, this just cant work, or am i wrong?

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

Bouvere wrote:
The version defined on the page I load using the @require url is always the latest version number, and the version you load from the meta file is the latest version number too! The script compares the latest version number to the latest version number, this just cant work, or am i wrong?

You don't understand how an @require works. When you install a script with an @require the @required script is downloaded to your hard drive. Since the script is my updater code it contains the latest version number at the time of install. The script then check periodically to see if the version number on the server is different from the version number stored on your hard drive. It does work. I can confirm this personally. If it isn't working for you then you aren't using it properly.

Edit: http://userscripts.org/topics/34594

 
Bouvere Scriptwright
FirefoxWindows

I think the main problem was, that i used 1.1a Version Numbers, instead of 1.1.1 for example. This could be the problem, now i got it to work properly. Thanks for the great script and sry for not understanding how it should work ^^

 
GotGs Scriptwright
FirefoxWindows

Hello,
I am not much of a javascript developer, but I too got a few errors in console. I tried to fixed them, and could have added a few others.. :)

You can check the changes here...

http://userscripts.org/scripts/show/95032 (search for your AnotherAutoUpdater)

We should probably not use "this." in anonymous functions within GM_registerMenuCommand().

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel