1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-29 01:45:34 +00:00
Commit Graph

52 Commits

Author SHA1 Message Date
Witold Filipczyk
38060fea51 [quickjs] scroll2.html works 2021-11-12 21:53:31 +01:00
Witold Filipczyk
183dca1c10 [quickjs] window.c 2021-10-31 20:48:10 +01:00
Witold Filipczyk
e15d58dfd1 [quickjs] element.c 2021-10-29 22:06:39 +02:00
Witold Filipczyk
33eab7d910 [ecmascript] Move location_goto to ecmascript.c 2021-10-22 10:44:37 +02:00
Witold Filipczyk
dc12c13244 [quickjs] Test commit. window.alert('Blabla') works. 2021-10-17 18:17:48 +02:00
Witold Filipczyk
6ffa7ec6e3 [ecmascript] Show message in status about enabling/disabling Ecmascript 2021-09-20 18:40:01 +02:00
Witold Filipczyk
929c8c9d81 [action] Added toggle-ecmascript action 2021-09-19 19:40:01 +02:00
Witold Filipczyk
5737a4d345 [console] console.error and fixes in jsval_to_string 2021-09-07 17:31:45 +02:00
Witold Filipczyk
7f572e7e4a [ecmascript] bump mozjs version to 68
Memory allocated in jsval_to_string is not freed anywhere.
2021-08-30 20:48:11 +02:00
Witold Filipczyk
4121b163c1 [ecmascript] Added some debug statements 2021-08-19 18:56:50 +02:00
Witold Filipczyk
13c4a1ce4d [spidermonkey] return location object
so document.location.href= redirects
2021-08-03 18:47:34 +02:00
Witold Filipczyk
927b8fc1a6 [js] moved check_for_rerender to ecmascript.c 2021-07-20 10:05:58 +02:00
Witold Filipczyk
871d47bf41 [js] Test commit for "rerendering" of page after modifcation by scripts 2021-06-05 21:58:29 +02:00
Witold Filipczyk
1af9c9fc31 [js] element.ownerDocument 2021-05-19 19:05:03 +02:00
nobody@earth.com
a19b95f20c [smjs local storage] spider monkey local storage 2021-02-22 23:27:19 +01:00
Witold Filipczyk
bc7a1ae6ad [console.log] Global variable to store console_log_filename 2021-02-22 15:55:12 +01:00
Witold Filipczyk
0fea79cc8f [cflags] Removed -Wno-pointer-sign
Likely some new bugs were introduced by this change.
The long term goal is clean compilation by g++.
2021-01-02 16:20:27 +01:00
Witold Filipczyk
f617256ecc [ecmascript] Allow ecmascript scripts only for given urls prefixes.
In ~/.elinks/allowed_ecmascript_url_prefixes.txt you must enter list
of urls. For example:
file://
https://buildlogs.pld-linux.org/
http://example

If url of document starts with one of given prefixes, then given url is
allowed to execute ecmascript. Start from most often used first.
2020-12-07 22:45:13 +01:00
Witold Filipczyk
3e3721582e [ecmascript] Guard for builds without mozjs. Refs #81 2020-11-23 20:11:47 +01:00
Witold Filipczyk
a92df85c11 [spidermonkey] Changes in setTimeout.
Spidermonkey is "hardcoded" in ecmascript, but ecmascript script engine
is rarely being changed.
2020-11-22 16:42:23 +01:00
Witold Filipczyk
873797935c [spidermonkey] Some code related to compartments. Progress. 2020-11-16 22:00:48 +01:00
Witold Filipczyk
8ad7d68b28 [js] Small progress.
It segfaults less often, but still, especially on non utf-8 pages.
And sometimes it did not work.
2020-10-28 22:32:20 +01:00
Witold Filipczyk
d1ecd45828 [mozjs52] It compiles, but often segfaults. No idea yet how to fix it. 2020-10-27 14:53:24 +01:00
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
Witold Filipczyk
3d96b0d7d7 Revert "Compile with C++."
This reverts commit 4f4df33638.
2019-04-21 12:27:40 +02:00
Witold Filipczyk
4f4df33638 Compile with C++.
Weak points:
- alignof
- js problems

Todo:
- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
2019-02-17 20:46:16 +01:00
Miciah Dashiel Butler Masters
f31cf6f9fe Heartbeat code using JS_TriggerOperationCallback
Implement new heartbeat code to catch runaway execution of document
ECMAScript code.  The old code uses JS_SetBranchCallback which is
deprecated in new versions of SpiderMonkey.  The new code uses setitimer(2)
and the JS_SetOperationCallback and JS_TriggerOperationCallback interfaces,
introduced in SpiderMonkey 1.8.1.  Compatibility with both the old
JS_SetBranchCallback and the new interfaces is maintained.
2009-11-26 00:57:21 +00:00
Miciah Dashiel Butler Masters
f62d2d1ae4 Add the number of interpreters to Resources box
Introduce static int interpreter_count in src/ecmascript/ecmascript.c.

Maintain interpreter_count in ecmascript_get_interpreter and
ecmascript_put_interpreter.

Introduce ecmascript_get_interpreter_count.

Display the number of ECMAScript interpreters that have been allocated
for documents in the Resources dialog box.
2008-09-06 20:18:10 +00:00
Kalle Olavi Niemitalo
a73fe73cd2 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	src/document/document.h
	src/encoding/encoding.c
	src/network/connection.c
	src/protocol/bittorrent/bittorrent.c
	src/protocol/bittorrent/bittorrent.h
	src/protocol/bittorrent/common.h
	src/protocol/bittorrent/connection.c
	src/protocol/bittorrent/dialogs.c
	src/protocol/bittorrent/tracker.c
	src/protocol/file/cgi.c
	src/protocol/http/http.c
2008-08-03 22:18:53 +03:00
Kalle Olavi Niemitalo
018af50f1d Rename cache_entry.id and related members.
cache_entry.id => cache_entry.cache_id
document.id => document.cache_id
ecmascript_interpreter.onload_snippets_owner => .onload_snippets_cache_id

This is a combination of:

commit 232c07aa7f
bug 1009: id variables renamed, added document_id to the document.

commit 6007043458bf8f14abfc18b9db60785bdc0279f6
Revert addition of document.document_id
2008-08-03 21:27:56 +03:00
Kalle Olavi Niemitalo
bbee237ff0 Merge branch 'elinks-0.12' into elinks-0.13 2008-07-20 14:47:40 +03:00
Kalle Olavi Niemitalo
759fbb1142 952, 954: Add ecmascript_detach_form_view stub
Anything that frees struct form_view must now call the new function
ecmascript_detach_form_view.  This function should then clear out any
dangling pointers, but that has not yet been implemented.
2008-07-18 20:00:16 +03:00
Kalle Olavi Niemitalo
bbadb99dd1 952, 954: Add ecmascript_{detach,moved}_form_state stubs
Anything that frees or reallocates struct form_state must now call the
new functions ecmascript_detach_form_state or ecmascript_moved_form_state.
These functions should then clear out any dangling pointers, but that has
not yet been implemented.
2008-07-18 19:56:49 +03:00
Witold Filipczyk
232c07aa7f bug 1009: id variables renamed, added document_id to the document.
cached->id => cached->cache_id
document->id => document->cache_id
onload_snippets_owner => onload_snippets_document_id
Added the distinct document->document_id.
Always reset ecmascript when a document changes for example a next chunk
of it is loaded.
2008-04-27 23:22:08 +03:00
Laurent MONIN
f0e66866f5 Trim trailing whitespaces. 2007-09-14 15:12:32 +02:00
Miciah Dashiel Butler Masters
ea372bd0cd get_opt_*: Add ses parameter
Add a session parameter to get_opt_ and its wrappers in preparation for session-specific and domain-specific options.
2007-08-28 17:24:59 +00:00
Kalle Olavi Niemitalo
2437d35904 Merge commit 'pasky.or.cz/elinks-0.12' into elinks-0.13
There were conflicts in src/document/css/ because 0.12.GIT switched
to LIST_OF(struct css_selector) and 0.13.GIT switched to struct
css_selector_set.  Resolved by using LIST_OF(struct css_selector)
inside struct css_selector_set.
2007-07-28 03:22:29 +03:00
Kalle Olavi Niemitalo
d3d2bb26c5 New macro LIST_OF for better Doxygen support. 2007-07-26 22:45:51 +03:00
Kalle Olavi Niemitalo
eccc8c23f0 Merge with http://elinks.cz/elinks.git#elinks-0.12 2007-07-09 16:03:06 +03:00
Kalle Olavi Niemitalo
58e3ebf2e7 Bug 957: Assert that the ECMAScript interpreter is not running.
Add ecmascript_interpreter.backend_nesting, increment it when
beginning to evaluate an expression, and decrement it when evaluation
finishes.  Then assert that it is zero in ecmascript_put_interpreter.
This detects bug 957 and similar ones before they corrupt memory.
2007-06-21 21:34:36 +03:00
Laurent MONIN
0b98c5051b Fix trailing whitespaces 2007-04-26 15:02:04 +02:00
Witold Filipczyk
6e08e1bf5d ECMAScript: Probably superfluous kill_timer. Removed unused include. 2006-10-24 19:10:10 +02:00
Witold Filipczyk
2fe0623298 Moved the setTimeout timer to the struct document. 2006-10-24 16:47:41 +02:00
Witold Filipczyk
cc4d02b0ae SEE: Added setTimeout function. 2006-10-23 22:45:55 +02:00
Witold Filipczyk
c571aea567 Ecmascript: 8 last urls opened by window.open() remembered in a safer way. 2006-04-02 17:00:55 +02:00
Witold Filipczyk
dc075685ae ECMAScript: better handling of set action 2006-03-21 18:45:40 +01:00
Miciah Dashiel Butler Masters
4b3d88dd6e Delegate ECMAScript submodule initialisation the right way
Replace the ECMAScript module initialisation and de-initialisation
routines that wrapped the SMJS and SEE module initialisation and
de-initialisation routines by having the module system call the SMJS
and SEE routines its own darned self.
2006-02-26 08:51:36 +00:00
62d42380f8 Added ret param for document.write 2006-01-27 12:07:45 +01:00
witekfl
d8592e4f99 Alternative experimental ECMAScript engine. 2006-01-10 19:17:29 +01:00
Jonas Fonseca
acf2ec806b Remove empty lines in start of header files
A left over from the CVS Id removal. Also, for a few files, normalize the
order in which things are declared in headers.
2005-11-15 11:33:27 +01:00