It is currently Wed Jan 22, 2020 8:28 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Eliminate debug warnings when using WebGadget in Linux
PostPosted: Sat Apr 06, 2013 5:46 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1677
Location: Germany
When using the WebGadget in Linux, these annoying debug warnings are always displayed in the error log several times in succession and one of them even in the status line:
PB error log wrote:
[18:28:05] [WARNING] Zeile: 5
[18:28:05] [WARNING] DEBUG: NP_initialize
[18:28:05] [WARNING] Zeile: 5
[18:28:05] [WARNING] DEBUG: NP_initialize succeeded
[18:28:05] [WARNING] Zeile: 5

This simple example code demonstrates it:
Code:
OpenWindow(0, 200, 100, 600, 300, "WebGadget")
WebGadget(0, 10, 10, 580, 280, "http://www.purebasic.com")

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow

In this thread I already posted the following possible solution which disables the embedding of scripts in WebKit thus eliminating the annoying warnings.
Code:
#G_TYPE_INT = 6 << 2

ImportC "-lwebkitgtk-1.0"
  webkit_web_settings_new()
  webkit_web_view_set_settings(*WebkitWebView, *WebkitSettings)
EndImport

Define Value.GValue

OpenWindow(0, 200, 100, 600, 300, "WebGadget")
WebGadget(0, 10, 10, 580, 280, "http://www.purebasic.com")

; ----- Get current webkit settings
WebkitSettings = webkit_web_settings_new()

; ----- Disable embedding of scripting languages
Value\g_type = #G_TYPE_INT
g_value_set_int_(Value, 0)
g_object_set_property_(WebkitSettings, "enable-scripts", @Value)

; ----- Store changed settings
webkit_web_view_set_settings(GadgetID(0), WebkitSettings)

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow

Therefore it would be nice to have this or a similar solution been implemented in PureBasic natively.


Top
 Profile  
Reply with quote  
 Post subject: Re: Eliminate debug warnings when using WebGadget in Linux
PostPosted: Sun Sep 20, 2015 11:46 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3729
Location: Berlin, Germany
Quote:
Eliminate debug warnings when using WebGadget in Linux

+1

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye