Browse Source

* Fix detection of push state api

michael 6 years ago
parent
commit
06ee490db9
1 changed files with 4 additions and 3 deletions
  1. 4 3
      packages/rtl/webrouter.pp

+ 4 - 3
packages/rtl/webrouter.pp

@@ -1251,7 +1251,8 @@ Var
   end;
   end;
 
 
 begin
 begin
-  if Result and isDefined(Window) and isDefined(Window.Navigator) then
+  Result:=False;
+  if isDefined(Window) and isDefined(Window.Navigator) then
     begin
     begin
     ua:=Window.Navigator.userAgent;
     ua:=Window.Navigator.userAgent;
     Result:=Not (
     Result:=Not (
@@ -1261,9 +1262,9 @@ begin
                  or IsB('Chrome')
                  or IsB('Chrome')
                  or isB('Windows Phone')
                  or isB('Windows Phone')
                  );
                  );
-    If Result then
-      Result:=isDefined(Window.history) and isDefined(Window.history);
     end;
     end;
+  If Result then
+    Result:=isDefined(Window.history) and isDefined(Window.history);
 end;
 end;
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------