Friends and neighbors,

I'm happy to answer my own post with a solution suggested by Sam L (Thanks, Sam!), which I implemented and posted to userscripts.org:

    http://userscripts.org/scripts/show/88074

Enjoy,

Dave

On Oct 12, 2010, at 4:14 PM, Dave Land wrote:

Hi, folks,

Before I make like a developer and try to figure this out and write it
myself, I thought I'd ask if anyone has heard of a GM script that does
this:

When viewing a book preview, attach events to the left and right arrow
keys to activate the "Previous Page" and "Next Page" buttons. I took a
swing at it today, but failed, and began to wonder if someone hadn't
already solved this problem.

Script developers:

The trick seems to be to simulate a click on the button link element,
such as this, the previous page button:

<a href="http://books.google.com/books?id=sVsEF-EGLE4C&amp;pg=PT884&amp;lpg=PP1&amp;dq=david+brin+earth " onclick="_OC_EmptyFunc(this.href); return false;">
    <div class="pagination">
<div id="prev_btn" alt="Previous Page" title="Previous Page" class="SPRITE_pagination_v2_left" style="cursor: pointer; "></div>
 </div>
</a>

I tried executing _OC_EmptyFunc (document.getElementById('prev_btn').parentNode.parentNode.href), but that did nothing: it really is an empty function, as advertised :-). It
is hard to figure out exactly what is happening when that link is
clicked.

It is easy enough to make the left arrow key set location .href=document.getElementById('prev_btn').parentNode.parentNode.href
but that loads the entire browser page (although showing the correct
book page), losing whatever page-size settings you have made.

Dave


--
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To post to this group, send email to [email protected] . To unsubscribe from this group, send email to [email protected] . For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en .

--
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to