-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set generous HTTP feature policy #114
base: master
Are you sure you want to change the base?
Conversation
User still needs to confirm use of features. Server settings take precedence anyway. Can be overridden by setting H5P_HTTP_FEATURE_POLICY.
Is used by Structure Strip, for instance
* @var string | ||
*/ | ||
protected static $h5p_http_feature_policy = 'accelerometer *; autoplay *; camera *; clipboard-write *; fullscreen *; geolocation *; gyroscope *; magnetometer *; microphone *;'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you can implement this with associative arrays that apply with a WordPress filter. Then generate the string based on the after-filtered associative array. It would give developers more flexibility to enable/disable permissions based on their site/platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kelvin-xu You're welcome to amend my pull request by sending me one of your own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR has been created for review. Thanks.
…by WordPress hooks.
Improve developer extendability on feature policy
This change will generously set HTTP feature policies to avoid issues with strict browsers if H5P content needs access to the camera, the microphone, etc. Please compare https://h5p.org/comment/35346 for details and for acceptance by Svein-Tore.
If this approach is feasible, I will gladly port it to Drupal and moodle.