Fix blank page on browsers without support for ResizeObserver

This corrects a bug in old browsers (Firefox, Waterfox, etc.) that don’t have support to “ResizeObserver” method.

First, copy the script ResizeObserver.js from there :
(inside “resize-observer-polyfill-1.5.1\dist” directory)
To : /core/js/

Next copy the templates (inside /core/templates/ ):
To /themes/YOUR_THEME_NAME/core/templates/

Add in each files this line :

<?php emit_css_loading_tags($_); ?>
<script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()); ?>" defer="" src="/core/js/ResizeObserver.js"></script>
<?php emit_script_loading_tags($_); ?>

Then activate your theme in /config/config.php

That’s it ! Enjoy ! :partying_face:

FOR NextCloud TEAM :
if you wish to include this in the next release, you can check there :
OR also a newer one (with .ts files) :

1 Like

Nextcloud doesn’t use this API. Hence I don’t see why we should monkey-patch this in our code base. We should identify the libraries that use it instead and fix the problem upstream.

To add some context: and

1 Like

Another solution from ltGuillaume :

Concerning that, isn’t there a way to include the JavaScript file in the theme, instead of putting in /core/js
was ok for me (where $this->themeEntity = in defaults.php has the same value of the theme directory name).

<script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()); ?>" defer="" src="/themes/<?php p($theme->getEntity()); ?>/core/js/ResizeObserver.js"></script>

A quick search on word “ResizeObserver” gave me this result : used in :



Let me guess: it’s found inside a javascript bundle :speak_no_evil:


Maybe this answer :


in all this templates, replace :

<?php include 'layout.noscript.warning.php'; ?>


<?php include getcwd().'/core/templates/layout.noscript.warning.php'; ?>

Just to confirm that we got the same error with users using Firefox 68.0.2 (linux mint 18.3).
Thanks a lot for this reporting :slight_smile: