Skip to content

Better log messages for canShare - #226

Merged
saschanaz merged 2 commits into
mainfrom
demo-files
Nov 22, 2021
Merged

saschanaz merged 2 commits into
mainfrom
demo-files

Conversation

@saschanaz

Copy link
Copy Markdown
Member

Related to #222

Comment thread demos/share-files.html
}

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

@saschanaz saschanaz Nov 19, 2021 •

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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?

@saschanaz saschanaz Nov 19, 2021 •

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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