Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/jsxc.nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsualko <klaus@jsxc.org>2020-03-28 20:29:29 +0300
committersualko <klaus@jsxc.org>2020-03-28 20:29:29 +0300
commit0371160f0eda7d3b5fd40ebee600d3e907297568 (patch)
treecac6a18fb24e1d74d3a77dbe041f860604c7dba4 /appinfo
parentfb4853ea6b1bdf40d6f4dd0fe181fe9531682657 (diff)
fix: adapt feature policy
Diffstat (limited to 'appinfo')
-rwxr-xr-xappinfo/app.php12
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();