[FIX] web: no ResizeObserver video error on chrome

When displaying a video, with the browser window at a certain size, or
resizing it (or opening developer tools) we could the following error:

 "ResizeObserver loop limit exceeded"

This can be reproduced in chromium just with this JS code:

  window.onerror = function(e){ console.log(e); };
  document.body.innerHTML = '<div><video controls src="v.webm"/>';

The issue only happen if:

- the video server does not support HTTP range requests
- the controls are displayed on the video
- browser size is in problematic size/resized to problematic size

And the error is raised in window.onerror but not displayed in the
developer console.

With this change, we ignore these errors until fixed in chromium.

chromium bug tracker: https://crbug.com/809574

backport of 12.0 535da9e (in pr #30239) since video loader was in 11.0
opw-1928512
closes #32983

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
Nicolas Lempereur
2019-04-26 11:53:38 +00:00
parent bc27113cf5
commit b09d20ab29
@@ -191,6 +191,10 @@ var AbstractWebClient = Widget.extend(mixins.ServiceProvider, {
});
}
} else {
// ignore Chrome video internal error: https://crbug.com/809574
if (!error && message === 'ResizeObserver loop limit exceeded') {
return;
}
var traceback = error ? error.stack : '';
crash_manager.show_error({
type: _t("Odoo Client Error"),