Run user script on clicking greasemonkey button

View: New views
9 Messages — Rating Filter:   Alert me  

Run user script on clicking greasemonkey button

by saruke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi
Is there a way to run the user script on clicking the greasemonkey
button on the firefox browser?

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


Re: Run user script on clicking greasemonkey button

by qufighter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


After greasemonkey is enabled by clicking the icon you must refresh
the page to execute the script.  Scripts that attach and run an onload
event for example would not function properly with clicking the icon
to run it as you described.  If you want to execute your code
optionally you must add your own button to the page using
createElement, addEventListener, setAttribute and appendChild

On Nov 1, 4:01 pm, saruke <saruke....@...> wrote:
> Hi
> Is there a way to run the user script on clicking the greasemonkey
> button on the firefox browser?
>
> Thanks in advance,
> Saruke
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-users@...
To unsubscribe from this group, send email to greasemonkey-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Run user script on clicking greasemonkey button

by Anthony Lieuallen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 11/01/09 16:01, saruke wrote:
> Is there a way to run the .. script on clicking [a] button ..

I think you're looking for bookmarklets.

I.E. http://www.squarefree.com/bookmarklets/

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


Re: Run user script on clicking greasemonkey button

by BD-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There is the Gm menu system (I think that still works), and I have made bookmarklets and GmScripts communicate, which might be a "no-no" due to security issues and that sort of thing. Although maybe you just need a 'simple' bookmarklet. It sure would be nice to have bookmarklets that weren't stored as bookmarks, though. It's a major pain to create them and edit them and look at them and document them, etc. Someone should make an extension for that. Kind of a cross between Greasemonkey and bookmarklets. With an accessible toolbar. It would be nice to have a Gm iconic Toolbar. I don't know if that's in the requests, or not.


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


Re: Run user script on clicking greasemonkey button

by saruke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thank you all for the response.

@qufighter
I want to enable other users to run the script optionally on some
pages which they desire to run it on. So I do not have control on the
page to create a button or any other element.

@Anthony
Bookmarklets can work for me, but I would keep this as a fallback
option.

@BD
A menu for greasemonkey to enable such selective running of scripts
would be great! Do you know if I can provide such a button by creating
a firefox extension? I can try to convert my script to an extension
using User Script Compiler -- http://arantius.com/misc/greasemonkey/script-compiler


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


Re: Run user script on clicking greasemonkey button

by Anthony Lieuallen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 11/02/09 15:21, saruke wrote:
> A menu for greasemonkey to enable such selective running of scripts
> would be great!

You're looking for GM_registerMenuCommand() .  It's there and works, but
is definitely not the best feature.

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


Re: Run user script on clicking greasemonkey button

by saruke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks Anthony, a greasemonkey browser toolbar would be more helpful
for my purpose so that the script can be run by any user by clicking
only once.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-users@...
To unsubscribe from this group, send email to greasemonkey-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Run user script on clicking greasemonkey button

by cc-21 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


It occurs to me that Jetpack (http://jetpack.mozillalabs.com/) is
probably able to do what you're looking for, though it's beta software
(if even that). Jetpack's difficulty of programming is roughly the same
as Greasemonkey's, in my experience, but there are rather more APIs
available (though not of the finished quality that Greasemonkey has, and
the coverage is uneven). Check it out!

On 2009-11-02 14:09, saruke wrote:
> Thanks Anthony, a greasemonkey browser toolbar would be more helpful
> for my purpose so that the script can be run by any user by clicking
> only once.
>    


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


Re: Run user script on clicking greasemonkey button

by gollum-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


There is also an older FF extension (haven't seen any activity for a
while) called Chickenfoot http://groups.csail.mit.edu/uid/chickenfoot/
This may(/may not) be helpfull.

On Nov 3, 7:21 am, saruke <saruke....@...> wrote:

> Thank you all for the response.
>
> @qufighter
> I want to enable other users to run the script optionally on some
> pages which they desire to run it on. So I do not have control on the
> page to create a button or any other element.
>
> @Anthony
> Bookmarklets can work for me, but I would keep this as a fallback
> option.
>
> @BD
> A menu for greasemonkey to enable such selective running of scripts
> would be great! Do you know if I can provide such a button by creating
> a firefox extension? I can try to convert my script to an extension
> using User Script Compiler --http://arantius.com/misc/greasemonkey/script-compiler
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemonkey-users@...
To unsubscribe from this group, send email to greasemonkey-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---