admin管理员组

文章数量:1291293

I want to write a greasemonkey script for my client to automate his tasks, however I don't want to share the script with others (as obviously, my client would not be too happy with this!)

How can I do write a greasemonkey script without sharing it with others?

I want to write a greasemonkey script for my client to automate his tasks, however I don't want to share the script with others (as obviously, my client would not be too happy with this!)

How can I do write a greasemonkey script without sharing it with others?

Share Improve this question edited Aug 31, 2012 at 13:39 Wladimir Palant 57.7k12 gold badges99 silver badges127 bronze badges asked Aug 31, 2012 at 11:56 ImdadImdad 6,0424 gold badges36 silver badges53 bronze badges 3
  • 3 You just do it. Writing a greasemonkey script doesn't necessarily involve publishing it anywhere. – user229044 Commented Aug 31, 2012 at 12:37
  • OK. great! can you tell me then how can I run/install the script in my browser without uploading it to the userscripts site – Imdad Commented Aug 31, 2012 at 12:57
  • 1 Just make a new script. No part of installing the script involves uploading it anywhere. – user229044 Commented Aug 31, 2012 at 13:01
Add a ment  | 

2 Answers 2

Reset to default 9

The question is not clear. But if you mean, "Can I stop my client from seeing the Greasemonkey script's code and possibly sharing it?"

Then the answer is "NO". Anyone using Firefox can see/edit the script's code via the Greasemonkey menu or the User Scripts tab in the Add-on manager.

This is by design. The producers of Greasemonkey (and most script authors) do not want any possibility of hidden or encrypted scripts being foisted on unsuspecting users.

~~~
Additionally, the script source can be seen by anyone with access to the client-machine's file system.



If you mean:

How can I run/install the script in my browser without uploading it to the userscripts site?

That's easy...

  1. Save your script to to a file, EG MyScript.user.js. Keep track of where you saved it, and make sure it's not in a system temp folder.
  2. In Firefox, choose Open File (CtrlO).
  3. Navigate to where you'd saved your script and open it.
  4. Greasemonkey will pop up a dialog asking if you want to install the script. Press Install.


See "Installing Scripts" in the documentation.

Make site with a link like this

<a href="http://yourserver./yourscript.user.js">Install special script xx</a> 

and save your script at

http://yourserver./yourscript.user.js

Grease Monkey and Tamper Monkey will see a javascript file and if it ends with user.js it will ask to install it. Give the url with the install link to your client. You can protect your site with a password.

本文标签: javascriptCan I write a private greasemonkey scriptStack Overflow