Skip to content

Conversation

@backportbot-nextcloud
Copy link

backport of #4822

Until now it was assumed that loading the image blurrer worker would not
fail. However, if the browser does not support the CSP "worker-src"
directive (like Safari) trying to load the worker would throw an
exception which would interrupt the load of Talk itself. Now the
exception is caught and logged instead, and the image blurrer reverts to
a synced generation if no worker is available (although that should not
happen, as the image blurrer is used only on Chromium and Chromium
supports the "worker-src" directive).

Note that Firefox does not throw an exception when loading a worker if
not allowed by the CSP. Moreover, as the worker object is created, it
does not seem to be possible to know if the worker is actually not
available. This is not a problem, though; the image blurrer is not used
on Firefox, and even if it was Firefox supports the "worker-src"
directive.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The image blurrer worker now is loaded only when it is actually needed,
so this should prevent the worker to be loaded on browsers other than
Chromium, as well as on Chromium if no call is joined.

This indirectly fixes the CSP error shown in Safari when the worker was
loaded (as the worker is no longer loaded now in Safari) due to Safari
not supporting the "worker-src" directive but requiring "child-src" to
be used instead.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@nickvergessen nickvergessen merged commit dfb50e8 into stable20 Jan 7, 2021
@nickvergessen nickvergessen deleted the backport/4822/stable20 branch January 7, 2021 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants