Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spidermonkey 1.8.5 is deprecated #29

Open
aelmahmoudy opened this issue Feb 1, 2019 · 22 comments
Open

Spidermonkey 1.8.5 is deprecated #29

aelmahmoudy opened this issue Feb 1, 2019 · 22 comments

Comments

@aelmahmoudy
Copy link
Contributor

Spidermonkey 1.8.5 has been removed from Debian, because it is unmaintained and has a security vulnerability. Could elinks migrate to mozjs-52 or mozjs-60 ?

@rkd77
Copy link
Owner

rkd77 commented Feb 10, 2019

I updated code to mozjs-17.0. Is this version maintained in Debian?

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Feb 11, 2019 via email

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Feb 11, 2019 via email

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Feb 14, 2019 via email

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Feb 16, 2019 via email

@aelmahmoudy
Copy link
Contributor Author

Couldn't this be done by adding a C wrapper around mozjs library instead of converting elinks' complete code to C++ ?

@rkd77
Copy link
Owner

rkd77 commented Feb 10, 2020

I don't know C++ nor SpiderMonkey. In the future it is possible, but not now.

@doughdemon
Copy link
Contributor

I'm looking into porting to newer versions of SpiderMonkey by compiling only the src/ecmascript and src/scripting/smjs directories with C++. This might work, though is not completely ideal because the mixture of C and C++ produces many type conversion warnings.

@rkd77
Copy link
Owner

rkd77 commented Aug 18, 2020

I would rather switch to QuickJS . It is C and has smaller memory footprint, but first I want to finish libdom "migration". I stopped on tables. JS is rather next year, not now.

@doughdemon
Copy link
Contributor

doughdemon commented Aug 19, 2020 via email

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Aug 27, 2020 via email

@niutech
Copy link

niutech commented Oct 27, 2020

Can't you use the Mozjs C API?

@rkd77
Copy link
Owner

rkd77 commented Oct 27, 2020

I spent too much time on SpiderMonkey to give up now.
It compiles with mozjs52, but segfaults. I have no idea yet, how to resolve it. If you know, please write it here, or prepare a patch. Usually it related to threads.
js::PerThreadData::runtimeFromMainThread (this=0x0)
or JS_AbortIfWrongThread(cx).

@niutech
Copy link

niutech commented Dec 30, 2021

According to the NEWS file, elinks 0.15.0 now uses mozjs78-dev or QuickJS-2021-03-27 for ECMAScript support. So can we close this issue?

@doughdemon
Copy link
Contributor

doughdemon commented Dec 30, 2021 via email

@MagicalDrizzle
Copy link

so currently you have to use mozjs78 correct? cause if yes then I wasted way too much time compiling mozjs17 oops

@rkd77
Copy link
Owner

rkd77 commented Mar 11, 2022

yes, either mozjs78 or quickjs, but do not expect too much.

@raekuul
Copy link

raekuul commented May 13, 2022

just as a heads-up: I had installed libmozjs-78-dev on a Debian Testing system and it was not detected by the configure script. The same system also has libmozjs-91-dev installed so it might be a package conflict.

@rkd77
Copy link
Owner

rkd77 commented May 14, 2022

You need also libsqlite3-dev and libxml++5.0.1.GIT or higher. I doubt libmozjs-91-dev has any influence on build process.
And add CC=g++ to ./configure invocation.
meson builds are faster.

@holtzermann17
Copy link

holtzermann17 commented Mar 15, 2023

Hi, just to update: I got it to build with recent libmozjs (revising to package=mozjs-102 in the configure file). I had to bring in some dependencies like this:

PKG_CONFIG_PATH="/opt/netsurf/pkgconfig:/opt/netsurf/inst-gtk2/lib/pkgconfig/" ./configure --with-spidermonkey --enable-256-colors

Configure reports:

...
checking for SpiderMonkey (mozjs-102) in pkg-config mozjs-102... yes
...
ECMAScript (JavaScript) ......... SpiderMonkey document scripting
...

The build completes successfully. However, even though I have the ECMAScript option turned on in elinks, when I go to https://www.whatismybrowser.com/detect/is-javascript-enabled, it tells me that it's not enabled.

Edit: I tried with quickjs instead, and still the site didn't detect Javascript enabled!

@rkd77
Copy link
Owner

rkd77 commented Mar 16, 2023

Besides examples in test directory, none of real scripts are operational. I want to "migrate" from libxml++ to libdom first, to be able to copy more code from netsurf. Progress is slow. js is postponed. The plan is to gradually make to work some scripts like a js terminal emulator, searching in Python docs, and playable tetris, but the first milestone I want to achieve is functional background colors in documents.

@andrewp907
Copy link

What is the current status of enabling JavaScript support on elinks on Debian?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants