• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

GreasemonkeyHacksForPMs

Page history last edited by PBworks 16 years ago

(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

  • Example - change a sports gym demo to a financial services demo

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

  • Xpather
  • Error Console (comes with FF)
  • View Source Chart
  • Firebug can also be used for these

 

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.

  • Uses text-encoded images for the icons in the page. This means he doesn't have to retrieve the images from the network - just embeds it as a text file.
  • Uses a website to create these text versions of images.
  • Could also load from a local directory

 

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/).