-
Notifications
You must be signed in to change notification settings - Fork 2k
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
FF supports navigator.share behind pref #12194
Conversation
@ddbeck Further to this, the webshare spec states that I just found this bug https://bugzilla.mozilla.org/show_bug.cgi?id=1635700 which indicates that FF does not support file sharing. Should we note this by marking the support in firefox as partial OR by adding a subfeature for @saschanaz Do you know when/if this feature is expected for Firefox? |
Sorry, I didn't quite follow this. You didn't mark the Mac partial implementation because you didn't test it? Or had reason to believe that this is a Chrome-specific limitation? The rest of this seems fine to me, I just want to figure out when/where we ought to be copying notes. |
Coming back to this after a couple of weeks - yes, that note is gibberish sorry. What I am saying is that Chrome marks The only reason I am questioning this is because I don't know the reason this was marked as partial support in the first place. If this could be because it is not supported on macOS then I could omit this caveat on android platforms. I guess I should add "partial" and the note for Opera though, as that runs on Mac. Does the question make sense now? |
Yes, this makes sense now. Reading the linked bug, it appears to be Mac specific, so I'd copy it to Edge and Opera. 👍 |
Thanks @ddbeck , |
It's not expected anytime soon, and |
And also probably a good chance to use |
@ddbeck @saschanaz OK, I added a files subfeature with versions based on
Question. Could/should we add subfeatures for text as well? The reason I ask is that Firefox for android does not support text sharing (at the moment captured with a note).
@ddbeck How do you do both a preference and a preview version? This is what it looks like now
This was added in nightly in FF92 - see https://bugzilla.mozilla.org/show_bug.cgi?id=1641280 . I think it was only added for Windows though - dunno if that matters (i.e. it doesn't if preview is assumed to be Windows for Firefox). "firefox": [
{
"version_added": "preview"
},
{
"version_added": "71",
"version_removed": "91",
"flags": [
{
"type": "preference",
"name": "#dom.webshare.enabled",
"value_to_set": "enabled"
}
]
}
], |
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.
Thanks, Hamish. Some general commentary here and a specific suggestion in a line comment.
Could/should we add subfeatures for text as well? The reason I ask is that Firefox for android does not support text sharing (at the moment captured with a note).
Yes, I endorse this. 👍
This was added in nightly in FF92 - see https://bugzilla.mozilla.org/show_bug.cgi?id=1641280 . I think it was only added for Windows though - dunno if that matters (i.e. it doesn't if preview is assumed to be Windows for Firefox).
I tried a few variants like this, but it can't cope with "preview". Ideas?
There's a lot to unpack here:
-
Operating system limitations imply
partial_implementation
."preview"
shouldn't change this. -
You said 'it can't cope with "preview"'. Sorry if I'm being dense, but can you elaborate on this? What's "it" and what is not coping, in this situation?
-
Based on the example, I'd interpret that to mean:
- In Nightly-only, it's enabled by default.
- In 71-91, it's available behind a pref.
- In 92+ (stable), it's no longer supported in anyway.
Is that the story you want to tell? If it isn't, what is?
Thanks, all helpful. I'll make the required changes tomorrow.
The story that I "know" is that prior to FF92 it is available behind pref ( 71-91), in FF92 it is available in Nightly by default and behind the pref for release. The restriction to Windows confuses me. My original understanding was that the preference change in Nightly was only for Windows, but that doesn't make much sense. @saschanaz is this a partial implementation? - ie this only works on Windows, or is it that we only enabled it for Windows, or is it that it behaves differently on Windows? Can you confirm? |
It's enabled on Windows and Android, and should generally work same way on both, except a nit: Windows does not support tracking share action properly, so it resolves after opening the share popup, not after completing the share action. (Same for Chrome) |
@saschanaz Ah, that wasn't clear to me, and makes this wrong: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share My understanding was that is that this should be re-written as:
Is that correct? Note the assertions:
I will correct the docs in line with your comment, but NOT record this nit as a compatibility issue in BCD. |
@ddbeck I have added With respect to adding preview, I still don't get how to do that. The story I am trying to tell is that it was added in version 71 behind a preference. From version 92 it is released (no pref required) in Nightly. I tried the following, but get
|
I don't think this can be a strong assertion as each OS may behave different. But correct at least on Android. |
@ddbeck When you get a chance, this needs re-review. As discussed, this is not an immediate priority, just keeping it visible. |
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.
Thanks, Hamish. Some suggestions in line comments.
Regarding Error: Invalid argument not valid semver ('preview' received)
, that's a bug. I'll open an issue about it.
api/Navigator.json
Outdated
}, | ||
"firefox_android": { | ||
"version_added": "79", | ||
"partial_implementation": true, | ||
"notes": "Firefox for Android does not support sharing files or text." | ||
"notes": "Firefox for Android does not support sharing text or files." |
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.
Since we have the subfeatures now, we can drop this note entirely
Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
@ddbeck Thanks for the review. I've "accepted all". |
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.
Thank you! 🎉
Navigator.share()
was marked false for FireFox desktop. However testing shows that it does work for desktop Windows (at least). I think it was added in FF71 in this bug behind the preferencedom.webshare.enabled
.Note that FF android is not blocked by this preference.
I also did some testing and verified that
Navigator.share()
andNavigator.canShare()
work on Windows Opera and Edge, and also Opera Android. I have guessed the versions for desktop match Chrome (but without the partial implementation warning due, I think, to MacOS issues).Upshot, those changes might perhaps revert to
true
if you think this is not a safe assumption.FYI these methods are protected by web-share permission. I have not added subfeatures for that, because I don't know if it is a compatibility issue (at all).