Userscripts Updater

By lazyttrick Last update Oct 23, 2011 — Installed 351,701 times.

Import?

in
Subscribe to Import? 18 posts, 6 voices



Chris4 Scriptwright

Hey,

Looks like you have a good updater script here. :)

One problem for me.. I have about 20 different scripts
installed; does this mean I have to re-install all of
them so Userscripts Updater can work with all of them?

If not, I suggest an import feature. :)

Chris

 
Node User

No, you don't need to. Have you read the Updates post? http://userscripts.org/topics/18633

 
Chris4 Scriptwright

Yes I read it and only the scripts I installed after installing Userscripts Updater are showing. None of my already installed scripts show.

 
Node User

Oh I see what you mean now. Yes, I had to reinstall the scripts in order to have Updater recognise the scripts I had installed before.

 
lazyttrick Script's Author

Theres this updater by alien_scum which hacks its way to access the scripts in the disk, but I'm not sure it works anymore.
http://userscripts.org/scripts/show/8877
I will take a look at it and see what I can learn.

 
sizzlemctwizzle Scriptwright

From what I understand alien_scum's script dances around permissions. It seems incredibly difficult to me, but would make your script much more useful. It is currently broken but one user claims to have fixed it http://userscripts.org/topics/14721?page=3#post...

 
Chris4 Scriptwright

I can't seem to get that working (also the patched version). It doesn't do anything. Doesn't open a tab like it says it should.

 
lazyttrick Script's Author

I've learned quite a bit from that script, very creative code.

 
Matrix0191 User

Okay When I Try The Import I Get Two Errors :(

[Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIDOMLocation.href]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: file:///C:/Users/Seth/AppData/Roaming/Mozilla/Firefox/Profiles/8d4vh6d1.default/extensions/%7Be4a8a97b-f2ed-450b-b12d-ee082ba24781%7D/components/greasemonkey.js :: importFromDisk :: line 712" data: no]

And

TypeError: objImportSearch.scriptAttr[0] is undefined

 
lazyttrick Script's Author

Matrix0191, for now the updater assumes you have your Firefox profile installed in that default location X:/Documents and Settings/username/... ... any language is supported, its only looks for the /

if you can, post your cache directory path in about:cache

 
Matrix0191 User

C:\Users\Seth\AppData\Local\Mozilla\Firefox\Profiles\8d4vh6d1.default\Cache

There You Go

 
lazyttrick Script's Author

try to paste the "C:\Users\Seth\AppData\Local\Mozilla\Firefox\Profiles\8d4vh6d1.default" at the options import field...

 
gishpuppy User

lazyttrick, love your work. But don't forget your fans that use the Mozilla Firefox, Portable Edition from PortableApps.com. :) Might the updater script be stored in a different (incompatible) location?

 
sizzlemctwizzle Scriptwright

I decided to rewrite your path guessing code(mostly for Mac support). It works on both mac and linux, and I think it should work on Windows, but I don't have a PC so I can't test it on that.

	                             try{
                                        // Get the Cache path no matter what it is
					path = document.body.innerHTML.match(/Cache Directory:<\/b><\/td>\n*<td><tt>\s*(.*)\s*<\/tt>/);
					}catch(e){
					}
					if(win_path = path[1].match(/(\D:.*\\)\D*Cache/)) // Windows
					{
					  // Untested
					  // <tt> X:\Users\<username>\AppData\Local\Mozilla\Firefox\Profiles\<profile>\Cache</tt>
					  // also works for X:\Users\<username>\AppData\Local\Mozilla\Firefox\Profiles\<profile>\OfflineCache for Firefox Portable
					  // X:\Users\<username>\AppData\Local\Mozilla\Firefox\Profiles\<profile>
					  path = 'file:///' + win_path[1].replace(/\\[^\\]+$/,'').replace(/\\/g,'\/').replace(/[^\/]+$/,'') + 'gm_scripts/config.xml';
					}
					else if (mac_path = path[1].match(/\/(Users\/.*)\/Cache/)) // Mac
					{
					  // Confirmed to work
					  // <tt> /Users/<username>/Library/Caches/Firefox/Profiles/<profile>/Cache</tt>
					  // Users/<username>/Library/Application Support/Firefox/Profiles/<profile>
					  path = 'file:///' + mac_path[1].replace(/Caches/, 'Application Support') + '/gm_scripts/config.xml';
					}
					else if (linux_path = path[1].match(/\/(home\/.*)\/Cache/)) // Linux
					{
					  // Confirmed to work(Ubuntu)
					  // <tt> /home/<username>/.mozilla/firefox/<profile>/Cache</tt>
					  // /home/<username>/.mozilla/firefox/<profile>
					  path = 'file:///' + linux_path[1] + '/gm_scripts/config.xml';
						
					}
                                       // If we caught the path then store it
					if (path.match(/file:/)) GM_setValue('importPath', escape(path));
					GM_setValue('import','doXML');
					location.href = path;
					break;

 
lazyttrick Script's Author

thanks, I'll take a look at this...

 
sizzlemctwizzle Scriptwright

thanks, I'll take a look at this...

Cool. Love the script btw.

 
lazyttrick Script's Author

glad to know :) much of the script came from collaboration and suggestions... It may take a while cause I'm always procrastinating, but...

 
sizzlemctwizzle Scriptwright


It may take a while cause I'm always procrastinating, but...

that's why you're called lazyttrick lol! Well if you could just confirm the code works in Windows then I know it works. I've checked in both OSX and Ubuntu. I wanted to check it in Windows but my damn VirtualBox is all fucked up right now. Which reminds me that I need to go get my MSDN login so I can download Vista for free. Maybe I'll check the code in that if I can get it setup tonight.
Edit: Well I got it to work Portable Firefox(I had to change the code a little and so I edited the above code to match). I'm still not sure about Vista though. I can tell you, however, that my code does not work on Windows 7, and I don't know why.

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