4

I want to insert some script into every page, which have some functions that will be called by the modified HTML of that page, using a Firefox extension. I am able to insert the JavaScript into the head of the HTML, and also modify the page, but the java script functions are not called by the onmouseover event. Does someone has any pointer on how to do that, using java script in local extension or as a online resource.

No GreaseMonkey, I need to do it with my plugin and not ask user to install greasemonkey, my plugin and the scripts.

1
  • Can u post example code or explain more about this part ? "Javascript functions are not called by the onmouseover event" Commented Oct 13, 2009 at 16:30

5 Answers 5

1

Greasemonkey does this. It's excellent!

Sign up to request clarification or add additional context in comments.

Comments

1

Make a Greasemonkey script. See Userscripts.org for lots of example ones to work off.

Comments

0

Why not use Greasemonkey? It allows you to execute javascript on any page on Firefox, and if executing the code you enter isn't good enough you could dynamically add links to the head, too.

1 Comment

I think the question made this pretty clear -- asking the user to install two extensions is awkward. The poster wants one extension with this functionality.
0

you can modify the DOM using Firebug. I am not sure if you can load files locally.. sounds malicious. Also, you can just run arbitrary javascript commands in the Firebug console (a la python/ruby console)

1 Comment

firebug shows me that the javascript is already there, but it not called, that's what the question is!
0

There are some Greasemonkey-to-extension "compilers" (or extension-wrappers) out there:

Arantius's GM compiler Gina Trapani's multiple-GM-script compiler

I've used the first one with extensive internal tweaking over time. However, I don't believe the compiler is actively maintained (default max-version is only 3.0), so may not be up-to-date with the latest GreaseMonkey, or FireFox.

I think Gina Trapani's is more designed for multiple scripts targetting the same domain, but I haven't used it.

Neither of these is a "GreaseMonkey solution" per se, as the end-user never has to install GreaseMonkey. They get a real-live FireFox extension. The core is very similar to GM, but you can change or add as much as you like.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.