You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For an alternate host environment (seeking to be browser-compatible) which borrows the Permissions API, how would you advise extending the PermissionName enum with permissions specific to its domain?
In Deno, we borrow the Permissions API for powerful features not supported by browsers. We swap out the specified PermissionName definition for the following:
The problem is the spec has it's own concretely defined enum. We've dodged that by defining ours in Deno.permissions instead of navigator.permissions, with the intention of reserving the latter for permissions that do exist in browser which we might also support isomorphically.
Since it's not ideal to have two separate permissions namespaces, we've been discussing just moving them all to navigator.permissions which would use a union of the w3c PermissionName and the one defined above.
My concerns are that:
This violates the spec of navigator.permissions in the way it is currently written. Could it be changed to allow any DOMString as a permission name instead of an enum? Instead of throwing for unsupported permission names, could it return { state: "unknown" } or something? Ref Support for custom permission types #130, Maybe add navigator.permissions.supports()? #136.
There could be name conflicts in the future between the web's and Deno's permission names. We can address this by prefixing our permission names with "deno-*", I guess. Thoughts on that?
Given all of that, is it more advisable for us to commit to having a separate Deno.permissions namespace forever, or moving to navigator.permissions despite the incompatibilities with the current spec? (What's the status of the suggestions linked in concern 1?)
The text was updated successfully, but these errors were encountered:
There could be name conflicts in the future between the web's and Deno's permission names. We can address this by prefixing our permission names with "deno-*", I guess. Thoughts on that?
That's also a lightweight and sensible solution, IMO.
For an alternate host environment (seeking to be browser-compatible) which borrows the Permissions API, how would you advise extending the
PermissionName
enum with permissions specific to its domain?In Deno, we borrow the Permissions API for powerful features not supported by browsers. We swap out the specified
PermissionName
definition for the following:The problem is the spec has it's own concretely defined enum. We've dodged that by defining ours in
Deno.permissions
instead ofnavigator.permissions
, with the intention of reserving the latter for permissions that do exist in browser which we might also support isomorphically.Since it's not ideal to have two separate
permissions
namespaces, we've been discussing just moving them all tonavigator.permissions
which would use a union of the w3cPermissionName
and the one defined above.My concerns are that:
navigator.permissions
in the way it is currently written. Could it be changed to allow any DOMString as a permission name instead of an enum? Instead of throwing for unsupported permission names, could it return{ state: "unknown" }
or something? Ref Support for custom permission types #130, Maybe add navigator.permissions.supports()? #136.Given all of that, is it more advisable for us to commit to having a separate
Deno.permissions
namespace forever, or moving tonavigator.permissions
despite the incompatibilities with the current spec? (What's the status of the suggestions linked in concern 1?)The text was updated successfully, but these errors were encountered: