]> git.openstreetmap.org Git - rails.git/commitdiff
Improve detection of browsers needing ES6 shims
authorTom Hughes <tom@compton.nu>
Fri, 22 Feb 2019 15:41:33 +0000 (15:41 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 22 Feb 2019 15:41:33 +0000 (15:41 +0000)
config/initializers/browser.rb

index 167fd293ca1ee63f36dc6a718d745232a47f8d70..29dc70672bdb6864450492b07f7331a8c66d951d 100644 (file)
@@ -2,15 +2,19 @@ module OpenStreetMap
   module Browser
     module Features
       def html5?
-        webkit? || firefox? || safari? || edge? || ie?(">8")
+        chrome? || firefox? || safari? || edge? || ie?(">8") || generic_webkit?
       end
 
       def es5?
-        webkit? || firefox? || safari? || edge? || ie?(">8")
+        chrome? || firefox? || safari? || edge? || ie?(">8") || generic_webkit?
       end
 
       def es6?
-        webkit? || firefox? || safari? || edge?
+        chrome?(">44") || firefox?(">24") || safari?(">7") || edge?(">11") || generic_webkit?
+      end
+
+      def generic_webkit?
+        webkit? && !chrome? && !safari? && !edge?
       end
     end
   end