chromium/third_party/blink/web_tests/http/tests/serviceworker/resources/memory-cache-controlled.html

<script>
var callback;

function getJSONP(url) {
  var sc = document.createElement('script');
  sc.src = url;
  document.body.appendChild(sc);
  return new Promise(function(resolve) {
      // This callback function is called by appending a script element.
      callback = function(data) { resolve(data); }
    });
}
</script>