It is currently Mon Jan 18, 2021 8:57 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: webkit rendered source
PostPosted: Wed Nov 11, 2020 3:29 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 20, 2014 6:32 pm
Posts: 248
Is it possible to get the rendered source with javascript with webkit?

This is what I have but seems to be not rendered.

Code:
ImportC "-lwebkitgtk-3.0"
  webkit_web_settings_new()
  webkit_web_view_set_settings(*WebkitWebView, *WebkitSettings)
  webkit_web_view_set_view_source_mode(*web_view, *view_source_mode)
  webkit_web_view_get_main_frame(*web_view)
  webkit_web_view_load_string(*WebView, Content.P-UTF8, *MIMEType, *Encoding, *BaseURI)
  webkit_web_view_get_dom_document(*web_view);
EndImport

Procedure EnableJSforWebGadget(WebgadgetID.i)
  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

OpenWindow(#PB_Any,0,0,800,600,"Test")
WebGadget(0,5,5,795,585,"https://www.google.com")
Debug webkit_web_view_set_view_source_mode(GadgetID(WebgadgetID.i),#True)
Debug webkit_web_view_get_dom_document(GadgetID(WebgadgetID.i))
;Debug Str(webkit_web_view_load_string(GadgetID(WebgadgetID.i), html, 0, 0, 0))
EnableJSforWebGadget(0)
Repeat

Event=WaitWindowEvent(1)

Until Event=#PB_Event_CloseWindow

_________________
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 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