[Greasemonkey] Passing information to other pages

mmccarthy at reifysoft.com mmccarthy at reifysoft.com
Tue Jul 5 01:34:22 EDT 2005


On each search result page, GM_setValue(location.href,
searchResults.join("|")).  On the auction item page, see if
GM_getValue(document.referrer) is defined.

If you key on URIs like in the above, you'll need a good system for tracking
them and deleting old values later (if deleting saved values is even
possible yet) so they don't accumulate endlessly.
 
Matt McCarthy
When I am king, you will be first against the wall 
With your opinion, which is of no consequence at all. 
-Radiohead, "Paranoid Android" 

-----Original Message-----
From: greasemonkey-bounces at mozdev.org
[mailto:greasemonkey-bounces at mozdev.org] On Behalf Of Thom Wetzel
Sent: Sunday, July 03, 2005 7:41 PM
To: greasemonkey at mozdev.org
Subject: Re: [Greasemonkey] Passing information to other pages

GM_getValue and GM_setValue would also work well and are easy to 
implement. 

The only tricky part is handling situations where someone would be 
interested in doing multiple searches at once using the script.  You'll 
need something tricky to know which search the current one is a part of. 

Thom


Shaun Etherton wrote:

>On Sun, 2005-07-03 at 15:51 -0700, Jason Diamond wrote:
>  
>
>>Hi.
>>
>>I just whipped up a script that modifies eBay to allow my wife to click
>>on a "Next item" link on a page to take her to the next item in the list
>>of items returned from the last search she made.
>>
>>http://jason.diamond.name/weblog/2005/07/03/ebay-next-item-link
>>
>>In order to get this to work, each item page needs to "know" what the
>>next item in the search results is but that information's not available
>>there on the item page. So I modified the links in the search results to
>>the item pages to "pass" that information to the item pages by appending
>>a query string parameter to the URL. The item pages then look for that
>>parameter and, if found, render an appropriate "Next item" link.
>>
>>It seems to be working exactly the way she wants it to work but I was
>>wondering if this was the best way to share information between pages.
>>Since the query string parameters are being sent to eBay with each
>>request, they could decide to "break" this script if they were so
inclined.
>>
>>Are there any other techniques that can be used to pass information to
>>other pages using Greasemonkey or is this a reasonable approach? I'm new
>>to writing user scripts (this is only my second) so thought I'd poll the
>>list to see if they had any better ideas.
>>
>>    
>>
>
>I guess you could use cookies.
>
>  
>
>>Thanks.
>>
>>    
>>

_______________________________________________
Greasemonkey mailing list
Greasemonkey at mozdev.org
http://mozdev.org/mailman/listinfo/greasemonkey




More information about the Greasemonkey mailing list