Recent

Author Topic: THtmlViewer - how to load a webpage?  (Read 372 times)

domasz

  • New Member
  • *
  • Posts: 39
THtmlViewer - how to load a webpage?
« on: August 15, 2022, 01:52:30 pm »
Hi!
This works nicely:
Code: Pascal  [Select][+][-]
  1. HtmlViewer1.LoadFromFile('test.htm');
But this doesn't:
Code: Pascal  [Select][+][-]
  1. HTmlViewer1.URL:='http://myserver.com/test.htm';

Do I need to do something special to load from http? Is there an event where I am supposed to download the page myself and feed THtmlViewer?

dje

  • Full Member
  • ***
  • Posts: 109
Re: THtmlViewer - how to load a webpage?
« Reply #1 on: August 15, 2022, 02:11:25 pm »
The example Browser.lpr supports http access via TIpHttpDataProvider (unit Iphttpbroker).
https://wiki.freepascal.org/TIpHttpDataProvider
Quote
The TIpHttpDataProvider handles requests for images and other files by retrieving them from the internet.

It appears to be a simple plug-n-play solution,
https://github.com/alrieckert/lazarus/blob/master/components/turbopower_ipro/examples/browserfrm.pas



domasz

  • New Member
  • *
  • Posts: 39
Re: THtmlViewer - how to load a webpage?
« Reply #2 on: August 15, 2022, 02:13:56 pm »
Thank you!

wp

  • Hero Member
  • *****
  • Posts: 10058
Re: THtmlViewer - how to load a webpage?
« Reply #3 on: August 15, 2022, 02:28:56 pm »
THtmlViewer <> TurboPower TIpHtmlPanel!

Verify which component (package) you are using.

domasz

  • New Member
  • *
  • Posts: 39
Re: THtmlViewer - how to load a webpage?
« Reply #4 on: August 15, 2022, 07:25:15 pm »
I use THtmlViewer

wp

  • Hero Member
  • *****
  • Posts: 10058
Re: THtmlViewer - how to load a webpage?
« Reply #5 on: August 15, 2022, 07:48:31 pm »
The HtmlViewer package contains a folder with lots of documentation (HtmlHelp). It says about TFrameBrowser.URL:

"Read only and run time only. The URL property returns the most recently selected (left mouse click) URL."

domasz

  • New Member
  • *
  • Posts: 39
Re: THtmlViewer - how to load a webpage?
« Reply #6 on: August 15, 2022, 07:54:34 pm »
The HtmlViewer package contains a folder with lots of documentation (HtmlHelp).
Thanks! I was looking for help in the F1 manual and in lazarus dir but thanks to you I found the dir with help:
C:\Users\{USER_NAME}\AppData\Local\lazarus\onlinepackagemanager\packages\HtmlViewer\HtmlHelp

 

TinyPortal © 2005-2018