9front - general discussion about 9front
 help / color / mirror / Atom feed
* adding javascript enable to netsurf
@ 2020-03-11  6:36 kokamoto
  2020-03-11  9:29 ` [9front] " jamos
  0 siblings, 1 reply; 2+ messages in thread
From: kokamoto @ 2020-03-11  6:36 UTC (permalink / raw)
  To: 9front

I'm still struggling this.
Error message says:
javascript_init: redifinition: javascript_init
(4481) TEXT javascript_init t0(SB). R0, $16

javascript_init is declared only once in
./netsurf/content/handlers/javascript/content.h:
nserror javascript_init(void);

However, I cannot find the body of that function anywhere...

The javascript_init is called from ./netsurf/content/handlers/javascript/duktape/dukky.c like:

/* 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();  <====
}

Please let me know the meaning of that comment, I'm not native English user,
then, it is difficult to understand why then javascript_init() is used here...

Kenji



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9front] adding javascript enable to netsurf
  2020-03-11  6:36 adding javascript enable to netsurf kokamoto
@ 2020-03-11  9:29 ` jamos
  0 siblings, 0 replies; 2+ messages in thread
From: jamos @ 2020-03-11  9:29 UTC (permalink / raw)
  To: 9front; +Cc: kokamoto

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 
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)      
\
nserror HNAME##_init(void) { … }

That is used in 'netsurf/content/handlers/javascript/content.c':

CONTENT_FACTORY_REGISTER_TYPES(javascript, javascript_types, 
javascript_content_handler);

I don’t 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
> 
> javascript_init is declared only once in
> ./netsurf/content/handlers/javascript/content.h:
> nserror javascript_init(void);
> 
> However, I cannot find the body of that function anywhere...
> 
> The javascript_init is called from 
> ./netsurf/content/handlers/javascript/duktape/dukky.c like:
> 
> /* 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();  <====
> }
> 
> Please let me know the meaning of that comment, I'm not native English 
> user,
> then, it is difficult to understand why then javascript_init() is used 
> here...
> 
> Kenji


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-11  9:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11  6:36 adding javascript enable to netsurf kokamoto
2020-03-11  9:29 ` [9front] " jamos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).