1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-30 01:55:30 +00:00
elinks/contrib/smjs
Kalle Olavi Niemitalo 9954d37a68 Move most of contrib/smjs/README into the manual.
Also document elinks.vs and elinks.action.

<kahmalo> Miciah: IMO most of contrib/smjs/README should be moved into
    the ELinks manual.  Specifically the parts that do not depend on
    contrib/smjs/hooks.js.  However manual.txt contains a notice:
    "Hold blameless the authors.  Any lawful use is allowed."  Will
    you allow that also for what is now in contrib/smjs/README?
<Miciah> Absolutely.
<Miciah> In fact, I would allow some lawless uses.
<Miciah> It seems a little silly to say that lawful uses are allowed.
2008-07-10 20:31:22 +03:00
..
google_video.js Fix for recent change in Google Video 2006-03-26 20:28:25 +00:00
hooks.js SMJS: block_pr0n: return the original URI if not blocking it 2006-10-20 23:10:36 +00:00
pornotube.js SMJS: Add scripts for YouTube and PornoTube 2006-10-20 23:11:25 +00:00
README Move most of contrib/smjs/README into the manual. 2008-07-10 20:31:22 +03:00
smartprefixes_bookmarks.js Return uri from rewrite_uri instead of true. 2005-12-29 22:28:58 +00:00
smartprefixes_classic.js Link to gitweb at repo.or.cz, rather than pasky.or.cz. 2007-06-21 10:29:06 +03:00
smartprefixes_common.js Link to gitweb at repo.or.cz, rather than pasky.or.cz. 2007-06-21 10:29:06 +03:00
youtube.js SMJS: Add scripts for YouTube and PornoTube 2006-10-20 23:11:25 +00:00

Most of the SpiderMonkey scripting interface is documented in the
ELinks manual.  This README describes only features added by
contrib/smjs/*.js.


Multiple functions in the same hook
-----------------------------------

The default hooks file contrib/smjs/hooks.js assigns functions that
provide a mechanism to register multiple functions to each hook. When
these default hooks are called, they iterate over all functions that
are registered to them, calling each one in serial.

If you want to register a preformat_html hook, for example,
the preferred way to do so is not this:

   elinks.preformat_html = foo;

but rather this:

   elinks.preformat_html_hooks.push(foo);

which adds foo to an array of functions, over which the default
elinks.preformat_html function will iterate.

If any function in that array returns false, the default hook
will stop iteration, not calling any more handlers. This applies
to all of the default hooks:

- elinks.preformat_html_hooks
- elinks.goto_url_hooks
- elinks.follow_url_hooks