Jump to content

More Greasemonkey


Recommended Posts

LordElph's excellent GeocachingOSMaps script (see the Greasemonkey Thread) inspired me to do a little Greasemonkey-ing around of my own, so I started at the top of my wish list:

 

1) Wouldn't it be nice if cache pages had an OS map embedded in them instead of that "really useful" :D grey map that shows half of England...

 

The resulting script will embed a 1:25000 OS map snippet on the cache page in place of the existing map with a small red circle displayed (very) approximately over the cache. The map is gleaned from the multimap web site and is linked to its original web page (so clicking on the map will take you to the relevant multimap page).

 

Once again, this will only work for users of the Firefox browser with the Greasemonkey extension installed (see the above linked thread for details on how to install Greasemonkey).

 

Once you have installed Greasemonkey, right click on the following link and select "Install User Script":

 

GeocachingOSMapEmbedder.user.js

 

Now go and visit a cache page.... Cool Huh? :D

 

Before

before.jpg

 

After

after.jpg

 

The script has a few problems at the moment, but I've still found it very useful:

1) It only works for mainland Britain at the moment, although I am working on a European version for my next holiday.... :D

 

2) The small red circle can be very approximate on occasions, and should be used as a guide only to the whereabouts of the cache, rely on your GPS when you get close...

 

3) When printed out, the red circle becomes a black square, blocking out the map immediately around the cache (I don't want to make it too easy! :P ), although I'm working on this too.

 

4) When no map can be found, it would be nice to revert to the original GC map rather than displaying the blank square.

 

Any other ideas for improvements, please let me know

 

:P

 

Edited to fix link to script :P

Edited by The Southseakers
Link to comment

Really cool..

 

I'd somehow missed the original thread so I've gone through the whole process in the last half hour. I'm really impressed with these little tweaks.

 

The thing I love about Firefox is that it works great on my Apple iBook as well as my PC.

 

Love it. :)

Link to comment

First time that I have changed a system and downloaded another to take its place, it all went like magic. Brilliant to say the least. The maps are certainly a lot better to look at.

Thanks for that one. Can one have their own homepage, or does it have to be that Firefox start with the Google bar?

Link to comment
this means nothing to me but I wondered if this site might be useful to you Greasemonkey geeks out there

 

Anyone with a modicum of Javascript ability will find Dive Into GreaseMonkey a fantastic resource.

 

Can one have their own homepage

yes - visit your preferred page and go to Tools -> Options and click General in the left hand bar, and you'll see the option for home page there - click the "use current pages" button.

 

Alternatively ,visit your chosen page, and see the icon next to the web address in the address bar? Probably looks like a blank page icon but might be a site-specific one? Drag and drop that onto the Home Page toolbar button.

Link to comment

What a belter!

 

These two monkeying about are really adding to the site - super work. Like Lacto, I too just marvel.

 

How to go from Z80 machine code geek (Hail to Rodney Zaks) to amazed onlooker in 20 years!

 

Trouble is, there are too many clever people out there and the call of the hammock and beer fridge it just too irresistable!!!

 

Keep up the good work you two, we are all impressed.... and thank you.

Link to comment
Brilliant! :unsure: Thanks lordelph.

That should be "Thanks Southseakers" ! He wrote the rather good map replacement extension, I wrote its predecessor, which links the OS coordinates to a 1:25000 map from Get-a-Map (it now includes an arrow for the cache coordinates too)

Link to comment
Brilliant!  :blink:  Thanks lordelph.

That should be "Thanks Southseakers" ! He wrote the rather good map replacement extension, I wrote its predecessor, which links the OS coordinates to a 1:25000 map from Get-a-Map (it now includes an arrow for the cache coordinates too)

Oops, sorry.. :wacko:

Thanks Southseakers! :unsure:

(it had been a long day...)

Edited by milvus-milvus
Link to comment

Just so you are all aware Greasmonkey functionality can be disabled by website designers.

 

document._createElement = document.createElement;

document.createElement = function(tagName, password) { if (tagName != "SCRIPT" || password == "My scripts are OK!") { return document._createElement(tagName); } };

 

This stops the plugins working.

I would expect advertisers to start using this soon to override all those cool scripts that have been written.

Link to comment
How to go from Z80 machine code geek (Hail to Rodney Zaks) to amazed onlooker in 20 years! 

Lol, I hear ya. I still have my 2 copies somewhere. :D:ph34r:

You and me, both !!!

 

I started with the somewhat restricted 8080 assembler instruction set and 'progressed' to Z80.

Now I have trouble writing a macro for GSAK :ph34r:

Edited by Pharisee
Link to comment
This stops the plugins working.

Thanks for the info, it motivated me to a bit of checking up:

 

The current version of Greasemonkey is immune to this particular trick. For those interested it seems that versions of Greasemonkey since 0.24 run scripts outside of the context of the DOM in their own environment and hence are not affected by mucking around with the document.

 

There are other ways of stopping pages working with Greasemonkey (apparently) but these are far more difficult and involve server side mucking about. However even these problems are due to be fixed in the next version of the Monkey (0.34) - Monkey Power! :anibad:

 

How to go from Z80 machine code geek (Hail to Rodney Zaks) to amazed onlooker in 20 years!

:lol: I started around the same time, cutting my first code on a friends home built ZX80 - if you couldn't do it in 1K of machine code it wasn't worth doing! :rolleyes: and of course the screen went blank every time you ran any code..... Now it just goes blue! :D

 

I just never stopped, and went on to make a career out of my hobby! Now I just have to find a way of doing that again..... :lol::lol::lol:

Link to comment
I just never stopped, and went on to make a career out of my hobby!

That's the trouble, I already was making a career out of my hobby ('planes and joined the RAF).

 

When digital computers came along, I was already up to my ears in OU and there just weren't the hours in the day!

 

....Ahh! The Hisoft Assembler, LERM - I remember them well, we had it tough.... and you tell the kids of today - they won't believe you!

Link to comment

Abso-frickkin-lutely spot on.

 

Just stumbled to this today, caught up with the other thread and have installed it all. Already a dedicated Firefox user, and this has made it even more worthwhile!

 

Now, to get back to coding my Palm app that will combine GSAK, GPXSonar and SpoilerSync for us PalmOS users! :rolleyes: All I have to do then is port Memory Map and I'm set!

Link to comment

Hello The Southseakers

 

I have just come across this wonderful thread and what and incredible piece of work, this lead me into thinking that it would be nice to have a larger map when clicking on the substituted embedded map. I'm not sure if this has been mentioned before so forgive me if it has but here is how I have amended your script to allow for larger maps.

 

The original section of the script which builds the Multimap looks like this:

 

var multiMapUrl = "http://www.multimap.com/map/browse.cgi?client=public"+

"&X="+(Math.round(east/10000)*10000)+

"&Y="+(Math.round(north/10000)*10000)+

"&width=500&height=300&"+

"&gride="+east+

"&gridn="+north+

"&srec=0&coordsys=gb&db=pc&zm=1&scale=25000";

 

and buy altering the final line by adding &width=900&height=900 like so

 

"&srec=0&coordsys=gb&db=pc&zm=1&scale=25000&width=900&height=900";

 

It is possible to get a map which gives you greater viewing area in the pop-up map, this I find gives superior cache finding powers :lol:

 

I hope that you might include this in your wonderful script as I am sure all would love to see bigger Multimaps for an example of the size just click here

 

I did not want to publish my modified script as I feel it is bad practice to not submit changes back to the author.

 

Thanks

 

Milton (aka Moote)

Edited by Moote
Link to comment

Greasemonkey had died completly for me - it looks like the faulty Greasemonkey update process is the culprit - this fixes it -

 

· Shut down Firefox.

· Find your profile directory

· Move profileDir/extensions/{e4a8a97b-f2ed-450b-b12d-ee082ba24781}/chrome/

greasemonkey/content/scripts/ to profileDir/scripts.

· Remove profileDir/gm_scripts if it exists

· Rename profileDir/scripts to profileDir/gm_scripts

· Restart Firefox

Edited by Learned Gerbil
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...