From 8a66875bd8932416d660adb5e78ab7e373bf1691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 27 Jun 2024 10:23:14 +0200 Subject: [PATCH] Remove all polyfill.io See: https://thehackernews.com/2024/06/over-110000-websites-affected-by.html --- api/dist/apihelp/apihelp.html | 4 ---- src/controllers/bootstrap.js | 14 -------------- 2 files changed, 18 deletions(-) diff --git a/api/dist/apihelp/apihelp.html b/api/dist/apihelp/apihelp.html index 5df00a390d00..c7ec457aadcc 100644 --- a/api/dist/apihelp/apihelp.html +++ b/api/dist/apihelp/apihelp.html @@ -54,10 +54,6 @@

Simple API Help

Basis

To use the API you should add the following HTML:


-<script
-  src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,default-3.6,Array.prototype.includes,Object.entries,Object.values"
-  crossorigin="anonymous">
-</script>
 <link href="https://geomapfish-demo-2-8.camptocamp.com/api.css" rel="stylesheet">
 <script src="https://geomapfish-demo-2-8.camptocamp.com/api.js?version=2"></script>
 <script>
diff --git a/src/controllers/bootstrap.js b/src/controllers/bootstrap.js
index 9a7ae781ecde..fa0f6650f5c5 100644
--- a/src/controllers/bootstrap.js
+++ b/src/controllers/bootstrap.js
@@ -59,20 +59,6 @@ function addStylesheet(stylesheetUrl) {
  * @param {angular.IModule} module The module
  */
 function bootstrap(module) {
-  // Hack to make the bootstrap type check working with polyfill.io
-  const oldObjectToString = Object.prototype.toString;
-  if (!oldObjectToString.toString().includes('[native code]')) {
-    Object.prototype.toString = function () {
-      if (this === null) {
-        return '[object Null]';
-      }
-      if (this === undefined) {
-        return '[object Undefined]';
-      }
-      return oldObjectToString.call(this);
-    };
-  }
-
   const interface_ = $('meta[name=interface]')[0].getAttribute('content');
   const dynamicUrl_ = $('meta[name=dynamicUrl]')[0].getAttribute('content');
   const appNameMeta = $('meta[name=appName]')[0];