w3c / window-management

Window Management API
https://www.w3.org/TR/window-management/
Other
95 stars 25 forks source link

This API cannot be used in the http environment, is there a solution? #106

Closed 342x closed 2 years ago

342x commented 2 years ago

Through the http environment · · · navigator.permissions.query({ name: 'window-placement' })··· Query permissions, always denied, is there a solution to this?

![Uploading 20220626135510.jpg…]()

Garbee commented 2 years ago

New features, particularly those that are powerful or have the potential to expose sensitive user information, require secure contexts to operate. As such, it is not eligible for usage on non-secured origins.

The W3C recommendation on Secure Contexts covers this: https://www.w3.org/TR/secure-contexts/#new

anssiko commented 2 years ago

@342x, as @Garbee explained, Secure Context is one of the established recommended mitigation strategies (https://www.w3.org/TR/security-privacy-questionnaire/#secure-contexts), adopted also by this specification.

Web developers usually run into this issue when testing and developing locally. You may find this article helpful: https://web.dev/how-to-use-local-https/