GreasemonkeyHacksForPMs


(P-Camp presentation by by Al Nevarez)

 

Working completely in the FF browser

 

GreaseMonkey is a quick way to make ff extensions.

 

Has given this talk a few times, but always to devs, not to PMs.

 

Shows short movie of using ~Greasemonkey to beautify MySpace.

 

Al is using it extensively to help his salesforce create demos and set up data

Recommends GreaseMonkey Hacks (Pilgrim) and DOM Scripting (Keith).

 

~GMail has a lot of GreaseMonkey tags. ~GMail is the most hacked web application out there.

 

Your script will break if they change the HTML.

 

Can use multiple ways to operate on elements - by ID, using ~XPath (e.g., "/div/p0", or via

 

Has a tab name changer, based on the URL

 

Three useful tools

 

Example: Puts Medallia logo onto the pCamp web page. Starts by showing use of Xpather to get the Xpath for the space for the missing logo on the website. wino kredyt mieszkaniowy sprzedam mieszkanie sprzedam bilet

 

Q: This looks very delicate - managing scripts, using them on different computers, etc. Ans: He uses a wiki page with helpful GM scripts and just keeps the latest copy there.

 

Q: If I use GM to prevent showing hi-def video, do I inhibit the download? Don't think so, GM works on the DOM, which it will load the whole thing.

 

Q: Can you alter the order of download? No. The download happens, and then the script runs.

 

Example: added links to Salesforce for accounts. Uses an Xpath to get the customer name, then adds new logos to the account page for accessing Google News and other searches, prefilled with search terms.

 

Also integrated SalesForce with LinkedIn.

 

Library example has one script that works both on Google Books and Peninsula Library System. Often uses a script per page, but it's possible to make a script that works across sites. (Just change the @include statement.)

 

Q: Can you make an interactive GM script? Yes, anything you can do in Javascript.

 

Q: What happens if the page has Javascript on it? Ans: The page's JS runs first, then GM's JS runs. If you want to access the native page's JS, you have to make a special call.

 

Example: Customizing any text on a page. A simple list-based script that will replace text with another text.

 

GreaseMonkey Hacks book has lots of example like this.

 

Al gave additional examples of how he's using this capability internally. He has a web page with some of his GM scripts (http://japaninyourpalm.com/hacks/).