It is currently Fri Nov 24, 2017 3:53 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: WebGadget() on Linux doesn't request *.js files?
PostPosted: Fri May 19, 2017 9:41 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jul 03, 2003 6:53 pm
Posts: 1111
Location: England
I've got a very simple window that contains a fullscreen WebGadget() and nothing more, it is connecting to a web server I've written in PB. The page being displayed in the WebGadget() doesn't function properly and I can see from the requests it's sending to my server it never actually retrieves the *.js files! The same code is working fine on Windows.

Any ideas what I'm doing wrong?


Top
 Profile  
Reply with quote  
 Post subject: Re: WebGadget() on Linux doesn't request *.js files?
PostPosted: Fri May 19, 2017 10:57 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jul 03, 2003 6:53 pm
Posts: 1111
Location: England
This problem is consistent on Ubuntu and Mint and whether I load the page using the server or the file protocol, the WebGadget() just does not request the *.js files.


Top
 Profile  
Reply with quote  
 Post subject: Re: WebGadget() on Linux doesn't request *.js files?
PostPosted: Fri May 19, 2017 1:58 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1070
Location: germany
I remember that JS is not enabled by default on the Linux WebGadget. I took a look into my code and found the following (I believe it is an extract of some answers here in the forum):
Code:
CompilerIf #PB_Compiler_Version > 540 
    ImportC "-lwebkitgtk-3.0"
CompilerElse
    ImportC "-lwebkitgtk-1.0"
CompilerEndIf   
    webkit_web_settings_new()
    webkit_web_view_set_settings(*WebkitWebView, *WebkitSettings)
EndImport
 
Procedure EnableJSforWebGadget(WebgadgetID.i)
    ; Enable JavaScript support in GTK3 WebGadgets
    Protected WebkitSettings.i
    ; ----- Get Webkit's default setting (with scripting languages enabled by default)
    WebkitSettings = webkit_web_settings_new()
    ; ----- Store Webkit's default settings in WebGadget
    webkit_web_view_set_settings(GadgetID(WebgadgetID.i), WebkitSettings)
EndProcedure


This works fine for me. I hope it works for you, too.


Top
 Profile  
Reply with quote  
 Post subject: Re: WebGadget() on Linux doesn't request *.js files?
PostPosted: Fri May 19, 2017 3:27 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jul 03, 2003 6:53 pm
Posts: 1111
Location: England
Thanks, Kukulkan :D


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: ehbarba, Saboteur and 16 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