Skip to content
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

Better log messages for canShare #226

Merged
merged 2 commits into from
Nov 22, 2021
Merged

Better log messages for canShare #226

merged 2 commits into from
Nov 22, 2021

Conversation

saschanaz
Copy link
Member

Related to #222

@@ -118,10 +118,20 @@ <h1>
textfield.value = '';
}

function checkBasicFileShare() {
// XXX: There is no straightforward API to do this.
Copy link
Member Author

@saschanaz saschanaz Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a problem, as already mentioned in #108 (comment). Something like this would help.

navigator.canShare("files"); // basic feature support
navigator.canShare("files", [files]); // matches canShare({files});

I believe this form of API is discussed somewhere around TPAC 2020 but can't find the log.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#184 was about canShareFiles with file types, but since Blink is now also checking file sizes, I guess receiving a sequence of files is needed?

Copy link
Member Author

@saschanaz saschanaz Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

canShare in Blink seemingly has no check for file types nor file sizes, and share() somehow throws PermissionError instead when it receives an unsupported file or too large file. Maybe to prevent fingerprinting? But then what's the point of canShare with the current form? 👀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe, "incremental improvement"?

@saschanaz saschanaz merged commit ac02175 into main Nov 22, 2021
@saschanaz saschanaz deleted the demo-files branch November 22, 2021 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants