[webkit-gtk] Handling Plugins and Error scanning plugin

Nicolas Jäger jagernicolas at legtux.org
Wed Jan 21 00:59:00 PST 2015


hi,

> The GAsyncResult you're passing to 
> webkit_web_context_get_plugins_finish() is uninitialized. It's passed 
> as the second argument to your callback, so you should declare at
> least that many parameters.
ok, to be honnest, I don't really understand what do and from where come
these asynchronous function. I'm just passing some pointers as you told
me :

void
callback( WebKitWebContext *web_context
        , GAsyncResult *result
        )
{
  GList *plugin_list, *p;
  GError *error = nullptr;

  plugin_list = webkit_web_context_get_plugins_finish (web_context,
  result, &error); if( error )
  {
    std::cout<< error->message << std::endl;
    exit(1);
  }


  for (p = plugin_list; p; p = p->next)
  {
    WebKitPlugin *plugin = WEBKIT_PLUGIN (p->data);
    std::cout << webkit_plugin_get_name (plugin) << std::endl;
    g_object_unref(p->data);
  }

  g_list_free(plugin_list);

}

> 
> You should also pass a GError unless you're sure you want to silence 
> errors. Something like this is typical:
 done.

so now when I start the browser, I still have some error messages,

Error scanning
plugin /usr/lib/mozilla/plugins/gecko-mediaplayer-dvx.so, /usr/lib/webkit2gtk-4.0/WebKitPluginProcess
returned 256 exit status Error scanning
plugin /usr/lib/mozilla/plugins/gecko-mediaplayer-qt.so, /usr/lib/webkit2gtk-4.0/WebKitPluginProcess
returned 256 exit status Error scanning
plugin /usr/lib/mozilla/plugins/gecko-mediaplayer-rm.so, /usr/lib/webkit2gtk-4.0/WebKitPluginProcess
returned 256 exit status Error scanning
plugin /usr/lib/mozilla/plugins/mozplugger.so, /usr/lib/webkit2gtk-4.0/WebKitPluginProcess
returned 256 exit status

 but no more segmentation fault (I guess it was because of the nullptr).
 I tested to go on several websites, I got no trouble except for one
site : YOUTUBE. No prob with dailymotion, several broadcast news
neither, just youtube!

there a copy of the errors :


[BEGIN OF ERRORS]

(WebKitWebProcess:3600): GLib-GObject-WARNING **: invalid (NULL)
pointer instance

(WebKitWebProcess:3600): GLib-GObject-CRITICAL **:
g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)'
failed 1
0xb4727ce3 /usr/lib/libjavascriptcoregtk-4.0.so.18(WTFCrash+0x23)
[0xb4727ce3] 2
0xb473473b /usr/lib/libjavascriptcoregtk-4.0.so.18(_ZN3WTF11fastReallocEPvj+0x1db)
[0xb473473b] 3
0xb425acaf /usr/lib/libjavascriptcoregtk-4.0.so.18(_ZN3JSC17BytecodeGenerator8generateEv+0x67f)
[0xb425acaf] 4
0xb457a352 /usr/lib/libjavascriptcoregtk-4.0.so.18(_ZN3JSC9CodeCache18getGlobalCodeBlockINS_24UnlinkedProgramCodeBlockENS_17ProgramExecutableEEEPT_RNS_2VMEPT0_RKNS_10SourceCodeENS_18JSParserStrictnessENS_12DebuggerModeENS_12ProfilerModeERNS_11ParserErrorE+0x5d2)
[0xb457a352] 5
0xb4576e2f /usr/lib/libjavascriptcoregtk-4.0.so.18(_ZN3JSC9CodeCache19getProgramCodeBlockERNS_2VMEPNS_17ProgramExecutableERKNS_10SourceCodeENS_18JSParserStrictnessENS_12DebuggerModeENS_12ProfilerModeERNS_11ParserErrorE+0x2f)
[0xb4576e2f] 6
0xb45d9695 /usr/lib/libjavascriptcoregtk-4.0.so.18(_ZN3JSC14JSGlobalObject22createProgramCodeBlockEPNS_9ExecStateEPNS_17ProgramExecutableEPPNS_8JSObjectE+0xf5)
[0xb45d9695] 7
0xb45a91c8 /usr/lib/libjavascriptcoregtk-4.0.so.18(_ZN3JSC17ProgramExecutable26initializeGlobalPropertiesERNS_2VMEPNS_9ExecStateEPNS_7JSScopeE+0x58)
[0xb45a91c8] 8
0xb4453260 /usr/lib/libjavascriptcoregtk-4.0.so.18(_ZN3JSC11Interpreter7exec
9
0xb458e23c /usr/lib/libjavascriptcoregtk-4.0.so.18(_ZN3JSC8evaluateEPNS_9Exe
10  0xb5d34d78 /usr/lib/libwebkit2gtk-4.0.so.37(+0x55dd78) [0xb5d34d78]
11  0xb5d35045 /usr/lib/libwebkit2gtk-4.0.so.37(+0x55e045) [0xb5d35045]
12  0xb5f19564 /usr/lib/libwebkit2gtk-4.0.so.37(+0x742564) [0xb5f19564]
13  0xb5f19da0 /usr/lib/libwebkit2gtk-4.0.so.37(+0x742da0) [0xb5f19da0]
14  0xb5f1d046 /usr/lib/libwebkit2gtk-4.0.so.37(+0x746046) [0xb5f1d046]
15  0xb5f1db9b /usr/lib/libwebkit2gtk-4.0.so.37(+0x746b9b) [0xb5f1db9b]
16  0xb5f1da66 /usr/lib/libwebkit2gtk-4.0.so.37(+0x746a66) [0xb5f1da66]
17  0xb63a0fee /usr/lib/libwebkit2gtk-4.0.so.37(+0xbc9fee) [0xb63a0fee]
18  0xb63a1022 /usr/lib/libwebkit2gtk-4.0.so.37(+0xbca022) [0xb63a1022]
19  0xb676b31b /usr/lib/libwebkit2gtk-4.0.so.37(+0xf9431b) [0xb676b31b]
20
0xb477257f /usr/lib/libjavascriptcoregtk-4.0.so.18(_ZN3WTF15GMainLoopSource1
21
0xb476e0af /usr/lib/libjavascriptcoregtk-4.0.so.18(_ZN3WTF15GMainLoopSource1
22  0xb476e0fc /usr/lib/libjavascriptcoregtk-4.0.so.18(+0x6a90fc)
[0xb476e0fc] 23
0xb48ad8d3 /usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x153)
[0xb48ad 24  0xb48adce9 /usr/lib/libglib-2.0.so.0(+0x46ce9)
[0xb48adce9] 25
0xb48ae099 /usr/lib/libglib-2.0.so.0(g_main_loop_run+0xf9) [0xb48ae099]
26  0xb6f9f369 /usr/lib/libwebkit2gtk-4.0.so.37(+0x17c8369)
[0xb6f9f369] 27
0xb5bd7a67 /usr/lib/libwebkit2gtk-4.0.so.37(WebProcessMainUnix+0x1d7)
[0xb5b 28
0x80485c2 /usr/lib/webkit2gtk-4.0/WebKitWebProcess(main+0x32)
[0x80485c2] 29  0xb5635e5e /usr/lib/libc.so.6(__libc_start_main+0xde)
[0xb5635e5e] 30  0x80485ee /usr/lib/webkit2gtk-4.0/WebKitWebProcess()
[0x80485ee]

[END OF ERRORS]

I really have no idea how to deal with that, as you can see there is no
error from the callback function. I can see at the very first line a
story about a null pointer, do I forget to set something ? I searched
during several hours from now, but I don't have any begin of clue. 

Then I wanted to switch the javascript plugins, since the word
javascript appears several times in the errors. At this point I went
here : 

https://wiki.gnome.org/Projects/WebKitGtk/ProgrammingGuide/Cookbook#Executing_JavaScript

this section of the website seems outdated, here is my code :

  WebKitWebView* webview;
  WebKitSettings *settings;
  webview =  WEBKIT_WEB_VIEW( webkit_web_view_new() );
  settings = webkit_settings_new ();
  std::cout << webkit_settings_get_enable_javascript(settings) <<
  std::endl;
  webkit_settings_set_enable_javascript(settings,false/*true*/);
  webkit_web_view_set_settings ( webview, settings ); std::cout <<
  webkit_settings_get_enable_javascript(settings) << std::endl;

now, when javascript is disabled, I can go without any error (even
without those about scanning) on youtube, but of course youtube asks me
to turn it on, and I have no video

regards,
/nicoo


More information about the webkit-gtk mailing list