Search code examples
delphibrowsertms-web-core

How do I get the user's browser window size in a Delphi TMS Web Core Website?


I want to get the size of the browser window using Delphi, how can I do this?


Solution

  • You can get it via the window class from the WEB unit:

    function GetBrowserWindowSize: String;
    begin
      Result := IntToStr(window.outerWidth) + 'x' + IntToStr(window.outerHeight);
    end;