Maps: NC17: Geolocation doesn't work anymore due to Feature Policy

Created on 27 Oct 2019  Â·  7Comments  Â·  Source: nextcloud/maps

After upgrading to NC17 the geolocation feature doesn't work anymore. If I go to the Maps app I get a browser warning about the issue (geolocation is allowed for my NC URL in my browser settings). When I try to jump to my current location by clicking on the little icon in the down-right area of Maps the same warning appears...

Geolocation error: Geolocation has been disabled in this document by Feature Policy..

I checked the Feature Policy via Mozilla's Observatory service and I found that NC17 has set the geolocation feature to 'none'.

Feature-Policy: autoplay 'self';camera 'self';fullscreen 'self';geolocation 'none';microphone 'self';payment 'none'

That issue didn't exist with NC16. So, I guess it probably is a NC core issue. But I'm not sure.

bug

Most helpful comment

Needs a fix in the maps app to enable this when the page is loaded. I can submit a PR.

All 7 comments

Changing the lines...

https://github.com/nextcloud/server/blob/773ce9e58f2f49fa07652070f87dbe90a7d4ae76/lib/public/AppFramework/Http/FeaturePolicy.php#L51-L52

to...

/** @var string[] of allowed domains that can use the geolocation of the device */
        protected $geolocationDomains = [
                '\'self\'',
        ];

...enables the geolocation feature. But this change will trigger a warning in the admin panel because of a non-matching file hash (altered file).

@rullzer what do we do here – should @AlfredSK submit the patch as a pull request to server, or should the Maps app specifically ask for permission?

Needs a fix in the maps app to enable this when the page is loaded. I can submit a PR.

I'll do that this evening/tomorrow (if not then ping me again ;) ).
It will be a bit hacky as otherwise 16 support gets dropped.

@rullzer ah cool, thanks a lot! cc @eneiluj @tacruc for info. :)

I'll do that this evening/tomorrow (if not then ping me again ;) ).
It will be a bit hacky as otherwise 16 support gets dropped.

@rullzer ping

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gucu picture gucu  Â·  7Comments

escoand picture escoand  Â·  8Comments

simonspa picture simonspa  Â·  7Comments

doc75 picture doc75  Â·  5Comments

jancborchardt picture jancborchardt  Â·  5Comments