Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: Fix errors when FileSystemFileEntry is unsupported#1417

Merged
Pytal merged 1 commit intomainfrom
fix/unsupported-file-system-file-entry
Sep 24, 2024
Merged

fix: Fix errors when FileSystemFileEntry is unsupported#1417
Pytal merged 1 commit intomainfrom
fix/unsupported-file-system-file-entry

Conversation

@Pytal
Copy link
Contributor

@Pytal Pytal commented Sep 24, 2024

When reaching the line on Chromium browsers it will throw

According to online docs FileSystemFileEntry should be available on Chrome but is not defined 😵

@Pytal Pytal added bug Something isn't working 3. to review Waiting for reviews labels Sep 24, 2024
@Pytal Pytal requested review from artonge and susnux September 24, 2024 17:39
@Pytal Pytal self-assigned this Sep 24, 2024
@Pytal Pytal enabled auto-merge September 24, 2024 17:39
Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

Yes code looks good :)

But I think we have also a problem here in the utils function, see:
https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API/Firefox_support#chrome_deviations_from_the_specification

@Pytal Pytal merged commit 2c83e6a into main Sep 24, 2024
@Pytal Pytal deleted the fix/unsupported-file-system-file-entry branch September 24, 2024 17:42
@Pytal
Copy link
Contributor Author

Pytal commented Sep 24, 2024

But I think we have also a problem here in the utils function, see: developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API/Firefox_support#chrome_deviations_from_the_specification

Uncaught ReferenceError: FileEntry is not defined hmm...

@Pytal
Copy link
Contributor Author

Pytal commented Sep 24, 2024

I think FileSystemFileHandle is used in Chrome

@susnux
Copy link
Contributor

susnux commented Sep 24, 2024

I think FileSystemFileHandle is used in Chrome

That is a different API (which is only used by Chrome as all other declined to use that due to security issues).

It seems like chrome does not provide those classes as public access, you still can log a file entry on chrome but the class prototype is not exposed.
So maybe we need to just check properties (isFile / isDirectory to detect which type it is).

@Pytal Pytal mentioned this pull request Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants