1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00
elinks/contrib/smjs
Witold Filipczyk 1f57e72212 [mozjs24] Allow build elinks with g++
SpiderMonkey was updated to mozjs24. If you want to build elinks
with ecmascript support, you must compile using g++ with -fpermissive .
There is a lot of warnings.
There are some memleaks in ecmascript code, especially related to JSAutoCompartment.
I don't know yet, where and how to free it.

Debian does not support mozjs24, so I'm going to gradually update SpiderMonkey version.
2020-10-05 20:14:55 +02:00
..
google_video.js
hooks.js
pornotube.js
README Move most of contrib/smjs/README into the manual. 2008-07-10 20:31:22 +03:00
smartprefixes_bookmarks.js
smartprefixes_classic.js [mozjs24] Allow build elinks with g++ 2020-10-05 20:14:55 +02:00
smartprefixes_common.js [mozjs24] Allow build elinks with g++ 2020-10-05 20:14:55 +02:00
youtube2.js youtube2.js: Show link to the video instead of the <meta refresh../>. 2009-01-03 17:39:02 +01:00
youtube.js

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