window.dispatchEvent doesn't work in Firefox, Safari or IE
<p>I need to force a resize of my browser window due to a promise that breaks IScroll on a very wide element (the problem is that I use a promise to change the width if promise succeeds). IScroll loads before the promise is finished and gets the with from the original element. The result is that I can only scroll as wide as the original element width, not the new width of the wider element loaded by the promise. If I manually resize the browser window, I can then scroll the full size. </p>

<p>I fixed this by changing IScroll's <code>maxScrollX</code> and <code>scrollerWidth</code> after the promise has loaded, but I also use an indicator that doesn't scroll all the way.</p>

<p>I try to fix this using <code>window.dispatchEvent(new Event('resize'));</code> to force a resize of the window. My problem is that this works fine in Chrome, but breaks the scroll altogether in Firefox, Safari and IE. Is there some other way to force a resize of the window that is compatible with all browsers?</p>

<p>I tried the following browsers which doesn't work:</p>

<ul>
<li>Safari 5.1.4 (734.54.16)</li>
<li>Firefox 45.0.2</li>
<li>Edge 25.10586.0.0</li>
</ul>