I know it was asked here many times and many times answered this is not a way how it should be done, but once more again :)

Is it possible, somehow, to call async function (such as timer / ajax call), basically common async task and synchronously wait until it ends without having 100%CPU usage and blocked browser?

Simple answer is enough - yes or no. If no i have to write all code depending on the async operation in "async way" Otherwise, it would be better ;)

imagine something like:

```js
updateCSS("someurl.css")

function updateCSS(url) {

   var css = getCachedResource(url);

   css = css.replace(/regexp/gm, function(curUrl) {
     base64 = atob(getCachedResource(curUrl))
     return "data:image;base64," + base64
   })

}

function getCachedResource(url) {

  //...

  if (cached) {

    return cached

  } else {

    // doajax...    
    // watfor

    return loaded
  }

}
```

Of course, I can make it async, but the code will be.... terrible. Moreover, I have to make async all functions calling this function. Can you see simple solution? Blocking would be simplest I would say.

Thanks