-
Notifications
You must be signed in to change notification settings - Fork 65
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
Should the share method be directly on Navigator? #180
Comments
Something like this looks feasible: [Exposed=Window, SecureContext]
interface NavigatorShare {
Promise<undefined> request(optional ShareData data = {});
boolean supportsBlob(DOMString mimeType); // based on the proposal from Marcos
// maybe also a share target registration api?
};
partial interface Navigator {
[SecureContext] NavigatorShare webshare; // needs a new name
}; |
Although arguably right about the namespace pollution and making feature detection easier and more consistent, I'd be reluctant to make drastic changes to the API's location at this point. The API surface is small enough that this is not a huge issue. |
But is it guaranteed to never get bigger? I already see proposals for more related methods... |
I agree with @marcoscaceres . The API has been shipped in multiple browsers for several years, and is in widespread use. It is probably a better idea to put the share method into its own namespace, but it is not worth making a breaking change to the API at this late stage. Indeed, there might be more methods added to Navigator, but it's a small amount of pollution. Contrary to this, when we designed the Badging API, we went in the opposite direction to Web Share, and proposed a I'm going to close this because it is not practical to make this change. |
Sent request to TAG to remove label https://lists.w3.org/Archives/Public/www-tag/2022Aug/0000.html |
From the TAG review:
Although this is only a single method, it may be better to add an interface to Navigator containing the share method rather than adding a method directly on Navigator. In the event that other methods or properties are added in the future it would prevent polluting the Navigator namespace and make feature detection easier and more consistent.
The text was updated successfully, but these errors were encountered: