Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Limit browser version
#1
Hi,

I'm building an app that requires the latest versions of browsers to be used. I found that IW support for the browser can be very forgiving, e.g., the app has to use Firefox v110 or newer, but IW can accept as old as 65.

Is there a way to limit the browser support?

I tried IWServerControllerBaseBrowserCheck to get the browser version, but I could not terminate the session as this event

Code:
procedure TIWServerController.IWServerControllerBaseBrowserCheck(
  aSession: TIWApplication; var rBrowser: TBrowser);
  var MinVersion: single;
  const _BrowserMinFirefox = 110;
        _sTerminateMin = ' min version is ';
begin
  if (rBrowser.BrowserName = 'Firefox') and (rBrowser.Version < _BrowserMinFirefox) then
    WebApplication.Terminate(rBrowser.BrowserName+_sTerminateMin+IntToStr(_BrowserMinFirefox)); //<-- Error here
end;



Thank you
Reply
#2
Hi there,

is there any real reason to block users using an older, although compatible, version of any browser?

IntraWeb applications will run (mostly) perfectly in any browser released after Internet Explorer 7 (included!) if you don't use any jQuery based control, or anything released after Internet Explorer 9/10/11 (if you are using jQuery based stuff, depending on what you are including) which is amazing, considered what IW offers out of the box.

To be honest it is the first time I see such requirement.

I was involved on a C#/TypeScript project recently that used the most "brilliant" and "modern" technologies and the web application refuses to run in anything different of Chrome (!!!!) which I think is a shame and the "oh everyone has chrome" excuse won't cut it.
Reply
#3
Technically responding your question, even though I believe you should reconsider your requirements, yes, IntraWeb is flexible enough to allow you to do mostly anything.

You can block the new session using a code such as this:


Code:
procedure TIWServerController.IWServerControllerBaseBrowserCheck(
  aSession: TIWApplication; var rBrowser: TBrowser);
begin
  rBrowser.Free;
  rBrowser := TChrome.Create(TChrome.MIN_VERSION - 1);
end;

With this code I'm creating an incompatible version of Chrome everytime. Of course you have to adjust this and add an *if* statement before this code to check for the browser version is not the latest (hint: you can use TBrowser.MajorVersion property for this, refering to the rBrowser instance, before releasing it of course). This will terminate the session and reject the request with a nice page with links to the latest version of major browsers (Chrome, Edge and Firefox). See below

   
Reply
#4
BTW, I think we should include Safari on that page :-)
Reply
#5
Hi Alex, thank you for your response…

I accidentally found that a compatible Chrome version 65 is not working well with other JS libraries I’m using. It’s easier for us to force using a newer version rather than keep chasing our tails with older variants…
Reply
#6
One thing that I've learned in all this time developing IntraWeb is: There will always be an incompatible Chrome version.

The Google Chrome developers introduce too many incompatibilities. I think that it would be normal for the cutting edge browser, pushing the web development forward. However that's not generally the case. Chrome drops things that work since centuries ago, for no reason. Then they realize that they shouldn't be doing that later...
Reply
#7
(11-21-2023, 05:59 AM)Alexandre Machado Wrote: Technically responding your question, even though I believe you should reconsider your requirements, yes, IntraWeb is flexible enough to allow you to do mostly anything.

You can block the new session using a code such as this:


Code:
procedure TIWServerController.IWServerControllerBaseBrowserCheck(
  aSession: TIWApplication; var rBrowser: TBrowser);
begin
  rBrowser.Free;
  rBrowser := TChrome.Create(TChrome.MIN_VERSION - 1);
end;

With this code I'm creating an incompatible version of Chrome everytime. Of course you have to adjust this and add an *if* statement before this code to check for the browser version is not the latest (hint: you can use TBrowser.MajorVersion property for this, refering to the rBrowser instance, before releasing it of course). This will terminate the session and reject the request with a nice page with links to the latest version of major browsers (Chrome, Edge and Firefox). See below

Hi Alexandre,

That's a good example! Is it possible to customize this page (especially the texts)?
The way to success is always under construction ... but i see a light at the end of the tunnel  Idea Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)