diff --git a/appinfo/app.php b/appinfo/app.php index 8650a508..bafc3467 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -22,7 +22,8 @@ namespace OCA\Richdocuments\AppInfo; -//Script for registering file actions +use OC\Security\CSP\ContentSecurityPolicy; + $eventDispatcher = \OC::$server->getEventDispatcher(); $eventDispatcher->addListener( 'OCA\Files::loadAdditionalScripts', @@ -47,5 +48,14 @@ if (class_exists('\OC\Files\Type\TemplateManager')) { $manager->registerTemplate('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'apps/richdocuments/assets/pptxtemplate.pptx'); } +// Whitelist the wopi URL for iframes, required for Firefox +$wopiUrl = \OC::$server->getConfig()->getAppValue('richdocuments', 'wopi_url'); +if ($wopiUrl !== '') { + $manager = \OC::$server->getContentSecurityPolicyManager(); + $policy = new ContentSecurityPolicy(); + $policy->addAllowedFrameDomain($wopiUrl); + $manager->addDefaultPolicy($policy); +} + // Listen to delete file signal \OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Richdocuments\Storage", "onDelete"); diff --git a/appinfo/info.xml b/appinfo/info.xml index 15f5ff99..36969f55 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ Collabora Online allows you to to work with all kinds of office documents directly in your browser. This application requires Collabora Cloudsuite to be installed on one of your servers, please read the documentation to learn more about that. Edit office documents directly in your browser. AGPL - 1.1.22 + 1.1.23 Collabora Productivity based on work of Frank Karlitschek, Victor Dubiniuk https://github.com/nextcloud/richdocuments/issues https://github.com/nextcloud/richdocuments.git