diff options
author | sualko <klaus@jsxc.org> | 2020-03-28 20:29:29 +0300 |
---|---|---|
committer | sualko <klaus@jsxc.org> | 2020-03-28 20:29:29 +0300 |
commit | 0371160f0eda7d3b5fd40ebee600d3e907297568 (patch) | |
tree | cac6a18fb24e1d74d3a77dbe041f860604c7dba4 /appinfo | |
parent | fb4853ea6b1bdf40d6f4dd0fe181fe9531682657 (diff) |
fix: adapt feature policy
Diffstat (limited to 'appinfo')
-rwxr-xr-x | appinfo/app.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index 5de6f1d..240e3c5 100755 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -34,6 +34,18 @@ addScript($urlGenerator->linkTo('ojsxc', 'js/bundle.js') . $versionHashSuffix); \OCP\Util::addStyle ( 'ojsxc', '../js/jsxc/styles/jsxc.bundle' ); \OCP\Util::addStyle ( 'ojsxc', 'bundle' ); +$dispatcher = \OC::$server->getEventDispatcher(); +$dispatcher->addListener(\OCP\Security\FeaturePolicy\AddFeaturePolicyEvent::class, function (\OCP\Security\FeaturePolicy\AddFeaturePolicyEvent $e) { + $fp = new \OCP\AppFramework\Http\EmptyFeaturePolicy(); + + $fp->addAllowedGeoLocationDomain('\'self\''); + $fp->addAllowedCameraDomain('\'self\''); + $fp->addAllowedFullScreenDomain('\'self\''); + $fp->addAllowedMicrophoneDomain('\'self\''); + + $e->addPolicy($fp); +}); + if(class_exists('\\OCP\\AppFramework\\Http\\EmptyContentSecurityPolicy')) { $manager = \OC::$server->getContentSecurityPolicyManager(); $policy = new \OCP\AppFramework\Http\EmptyContentSecurityPolicy(); |