Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

User agent and resolution

 Post Reply Post Reply
Author
Gomezel Dino View Drop Down
New Member
New Member
Avatar

Joined: 02 Dec 2010
Posts: 16
Post Options Post Options   Quote Gomezel Dino Quote  Post ReplyReply Direct Link To This Post Topic: User agent and resolution
    Posted: 30 Aug 2018 at 11:31pm
Which is the best way to see the user agent and the resolution of the client browser.

The goal is to adapt the look to the application based on the client capabilities.
So programatically switch between the mobile view and the desktop view.
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 7925
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 31 Aug 2018 at 11:01am
To see the user agent, add the web unit to the uses list and write:

procedure TForm1.WebButton1Click(Sender: TObject);
begin
  caption := window.navigator.userAgent;
end;

To get the screen resolution:

procedure TForm1.WebButton1Click(Sender: TObject);
begin
  caption := string(window.screen['width'])+':'+string(window.screen['height']);
end;

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down