From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.oboj.net ([195.178.185.14]) by ewsd; Wed Mar 11 05:29:13 EDT 2020 Received: from localhost (localhost [127.0.0.1]) by mail.oboj.net (Postfix) with ESMTP id 6ABECBCFD08; Wed, 11 Mar 2020 10:29:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.oboj.net Received: from mail.oboj.net ([127.0.0.1]) by localhost (mail.oboj.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s1_D5GajcHXb; Wed, 11 Mar 2020 10:29:03 +0100 (CET) Received: from www.oboj.net (unknown [195.178.185.23]) by mail.oboj.net (Postfix) with ESMTP id B5BA4BCFD07; Wed, 11 Mar 2020 10:29:03 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Date: Wed, 11 Mar 2020 10:29:03 +0100 From: jamos@oboj.net To: 9front@9front.org Cc: kokamoto@hera.eonet.ne.jp Subject: Re: [9front] adding javascript enable to netsurf In-Reply-To: <8241A7164C792D348AD9BD941C063BB5@hera.eonet.ne.jp> References: <8241A7164C792D348AD9BD941C063BB5@hera.eonet.ne.jp> Message-ID: <80e9edc42326584c4073d484bef78e14@oboj.net> X-Sender: jamos@oboj.net User-Agent: Roundcube Webmail/1.3.4 Content-Transfer-Encoding: quoted-printable List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: progressive blockchain DOM service Reverse engineering a Linux executable, there is indeed a javascript_init() defined. It looks like it comes form the following object file: nm netsurf/build/Linux-gtk/content_handlers_javascript_content.o | grep=20 javascript_init 0000000000000150 T javascript_init I cannot either find the proper declaration for the function in the source, but maybe it is autogenerated somehow. In 'netsurf/content/content_factory.h' I find the macro: #define CONTENT_FACTORY_REGISTER_TYPES(HNAME, HTYPELIST, HHANDLER) =20 \ nserror HNAME##_init(void) { =E2=80=A6 } That is used in 'netsurf/content/handlers/javascript/content.c': CONTENT_FACTORY_REGISTER_TYPES(javascript, javascript_types,=20 javascript_content_handler); I don=E2=80=99t have the time right now to investigate further, but maybe those findings can lead you a bit further. Duktape can be enabled/disabled both in compile time and runtime too, I think. Jonas On 2020-03-11 07:36, kokamoto@hera.eonet.ne.jp wrote: > I'm still struggling this. > Error message says: > javascript_init: redifinition: javascript_init > (4481) TEXT javascript_init t0(SB). R0, $16 >=20 > javascript_init is declared only once in > ./netsurf/content/handlers/javascript/content.h: > nserror javascript_init(void); >=20 > However, I cannot find the body of that function anywhere... >=20 > The javascript_init is called from=20 > ./netsurf/content/handlers/javascript/duktape/dukky.c like: >=20 > /* exported interface documented in js.h */ > void js_initialise(void) > { > /** TODO: Forces JS on for our testing, needs changing before a release > * lest we incur the wrath of others. > */ > /* Disabled force-on for forthcoming release */ > /* nsoption_set_bool(enable_javascript, true); > */ > javascript_init(); <=3D=3D=3D=3D > } >=20 > Please let me know the meaning of that comment, I'm not native English=20 > user, > then, it is difficult to understand why then javascript_init() is used=20 > here... >=20 > Kenji