const base = document.querySelector('#fallback-js').dataset.base;

// check for jQuery presence
!!window.jQuery || document.write('<script src="' + (base || '') + '/assets/js/vendor/jquery.min.js"><\/script>');

// check for Promise support
!!window.Promise || document.write('<script src="' + (base || '') + '/assets/js/vendor/promise.min.js"><\/script>');

if (!window.location.origin) {
  window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
}

window.requestIdleCallback =
  window.requestIdleCallback ||
  function(cb) {
    const start = Date.now();
    return setTimeout(() => {
      cb({
        didTimeout: false,
        timeRemaining: () => {
          return Math.max(0, 50 - (Date.now() - start));
        }
      });
    }, 1);
  }

window.cancelIdleCallback =
  window.cancelIdleCallback ||
  function(id) {
    clearTimeout(id);
  }

@@ -1,68 +1,262 @@
-const base = document.querySelector('#fallback-js').dataset.base
+// current script src dir%0Aconst src = %5B%5D.slice.call(document.querySelectorAll('script'), 0).pop().src.replace(/%5C/%5B%5E%5C/%5D+$/, '');%0A%0A// demonstrate javascript support%0Aconst html = document.documentElement;%0Ahtml.classList.remove('no-js');%0Ahtml.classList.add('js')
 ;%0A%0A/
@@ -309,33 +309,33 @@
  document.write(
-'
+%60
 %3Cscript src=%22' +
@@ -335,38 +335,14 @@
 rc=%22
-' + (base %7C%7C '') + '/assets/js
+$%7Bsrc%7D
 /ven
@@ -366,25 +366,25 @@
 %22%3E%3C%5C/script%3E
-'
+%60
 );%0A%0A// check
@@ -439,17 +439,17 @@
 t.write(
-'
+%60
 %3Cscript 
@@ -457,53 +457,221 @@
 rc=%22
-' + (base %7C%7C '') + '/assets/js/vendor/promise
+$%7Bsrc%7D/vendor/promise.min.js%22%3E%3C%5C/script%3E%60);%0A%0A// check for object-fit support%0A!!('objectFit' in html.style) %7C%7C (html.classList.add('no-objectfit'), document.write(%60%3Cscript src=%22$%7Bsrc%7D/vendor/objectFitPolyfill.basic
 .min
@@ -685,21 +685,71 @@
 /script%3E
-'
+%60)
 );%0A%0A
+// check for location origin support (mostly IE)%0A
 if (!win
@@ -919,16 +919,52 @@
 '');%0A%7D%0A%0A
+// fallback for requestIdleCallback%0A
 window.r
@@ -1255,16 +1255,51 @@
 );%0A  %7D%0A%0A
+// fallback for cancelIdleCallback%0A
 window.c

update fallback.js