Jump to content

Recommended Posts

Posted

Hello!

How I can show standart, any html page (can use images) in UniGUI?

I have one html web page (for example: http://myhtml.html) and I want show this page to user, maybe using UniHTMLFrame, not in browser, in my project. 

Posted

Hello,

Yes, you can do this inside your UniGUI app without opening an external browser.

You actually have two different components depending on what exactly you want to show:

1. UniURLFrame — for displaying an external page by URL (this is probably what you want):

UniURLFrame1.URL := 'http://example.com/mypage.html';

Internally it uses an <iframe>, so images, CSS and JS from that page work normally.

2. UniHTMLFrame — for injecting raw HTML content that you generate or load yourself:

UniHTMLFrame1.HTML.LoadFromFile('C:\path\to\myhtml.html');
// or
UniHTMLFrame1.HTML.Text := '<h1>Hello</h1><img src="files/pic.png">';

Rule of thumb: got a URL → UniURLFrame. Got HTML text/file → UniHTMLFrame.

Important caveat for both: many modern sites (Google, YouTube, Facebook, most banking sites, etc.) send an X-Frame-Options: DENY/SAMEORIGIN header or a Content-Security-Policy: frame-ancestors directive, which tells the browser to refuse rendering inside a frame. You'll just get a blank area — and it can't be bypassed from the client side, that's a security feature against clickjacking.

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...