PithHelmet Machete FAQ
...one would be remiss to go on Safari without Machete...
- What is Machete?
- I know very little about coding. What should I do?
- I know this and that about coding. What should I do?
- What programming language should I use?
- Does this mean I should use python?
- Can I use byte-compiled versions to speed up loading time? Can I write my code in C?
- Do my individual rules inherit scripts from the Default Site Rule?
- How can I attach multiple scripts to one rule?
- I just disabled PithHelmet and reloaded but my machete script is still getting invoked. Why?
- This FAQ is rubbish and didn't answer any of my questions.
1. What is Machete?
Read
this first, if you haven't already (the referenced Amazon rule's script is also below). If you don't know what PithHelmet is, start at the
beginning.
2. I know very little about coding. What should I do?
The
ParentPage (where you came from, presumably) has a list of contributed rules (M = Machete ones) that can be downloaded and used by anyone. Play around with them first.
3. I know this and that about coding. What should I do?
The bottom of this page contains a continuously updated list of sample code you can study. Add to it once you've written/obtained some useful code.
4. What programming language should I use?
Officially, Machete supports bash, perl, and python scripts. In reality, the script name merely has to end in .sh, .pl, or .py (unless you hexedit /Library/Application\ Support/SIMBL/plugins/pithHelmet.bundle/contents/macos/pithHelmet and modify the line containing ".py..pl..sh"). So far, contributed scripts have been written in:
bash - one
perl - some
python - lots
ruby - some
Javascript files should be attached in the "style" pane, not here.
5. Does this mean I should use python?
Not necessarily. Use whatever's most efficient, ideally. As to what that is...
6. Can I use byte-compiled versions to speed up loading time? Can I write my code in C?
I couldn't get this to work.
7. Do my individual rules inherit scripts from the Default Site Rule?
No. Maybe in a future release.
8. How can I attach multiple scripts to one rule?
If they're all written in the same language you could probably import all the other files from the main one.
9. I just disabled PithHelmet and reloaded but my machete script is still getting invoked. Why?
The "inline proxy" is still active, regardless of pithHelmet's state. If you want to disable a script, you'll have to change it back to "None Selected" in the Advanced Pane.
10. This FAQ is rubbish and didn't answer any of my questions.
Good question. By all means, improve it.
Sample Code
|
File |
Description |
Author |
|
adds access keys Control-N, Control-P for links named next, previous, back |
||
|
allows autofill on form fields that disable it |
||
|
kill the refocus so Amazon no longer pops to the front on load |
||
|
replace news ticker with link to it |
rahul |
|
|
another perl script here |
map |
|
|
camino's ("capability.policy.default.HTMLInputElement.focus", "noAccess") |
rahul |
|
|
prevents almost all normal links from opening in a new window |
burris |
|
|
kill looping events (setTimeout() and setInterval()) |
rahul |
|
|
various ruby scripts and their python equivalents |
reeses |
Wikir