diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-05-14 09:00:33 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-05-22 09:42:33 +0300 |
commit | cedbdb296c69d8a91f1369d2abde605670d3b429 (patch) | |
tree | 54eb25a2ec5a700f4e2e3cacd739ace2aead927e /lib | |
parent | d0eba26c7c54b93329b24907240480ecda44dd78 (diff) |
Basic viewer integration
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AppInfo/Application.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index b9ca89f5..bf8237f0 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -34,7 +34,9 @@ use OCA\Richdocuments\Preview\OOXML; use OCA\Richdocuments\Preview\OpenDocument; use OCA\Richdocuments\Preview\Pdf; use OCA\Richdocuments\Service\FederationService; +use OCA\Viewer\Event\LoadViewer; use OCP\AppFramework\App; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IPreview; class Application extends App { @@ -44,6 +46,12 @@ class Application extends App { public function __construct(array $urlParams = array()) { parent::__construct(self::APPNAME, $urlParams); + /** @var IEventDispatcher $eventDispatcher */ + $eventDispatcher = $this->getContainer()->getServer()->query(IEventDispatcher::class); + $eventDispatcher->addListener(LoadViewer::class, function () { + \OCP\Util::addScript('richdocuments', 'viewer'); + }); + $this->getContainer()->registerCapability(Capabilities::class); } @@ -93,6 +101,7 @@ class Application extends App { $cspManager = $container->getServer()->getContentSecurityPolicyManager(); $policy = new ContentSecurityPolicy(); if ($publicWopiUrl !== '') { + $policy->addAllowedFrameDomain('\'self\''); $policy->addAllowedFrameDomain($publicWopiUrl); if (method_exists($policy, 'addAllowedFormActionDomain')) { $policy->addAllowedFormActionDomain($publicWopiUrl); |