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

supported always returns false when in iframe #138

Closed
msvinth-work opened this issue Feb 26, 2023 · 2 comments
Closed

supported always returns false when in iframe #138

msvinth-work opened this issue Feb 26, 2023 · 2 comments

Comments

@msvinth-work
Copy link

msvinth-work commented Feb 26, 2023

The supported function seems to have a bug due to "else if" instead of "if" and always return false even when in a first-party iframe.

In line 39 in main/src/supported.mjs

Should properly be

 } 
 if ('showOpenFilePicker' in self) {
    return 'showOpenFilePicker';
 }

instead of

  } else if ('showOpenFilePicker' in self) {
    return 'showOpenFilePicker';
  }
@msvinth-work msvinth-work changed the title supported always return false when in iframe supported always returns false when in iframe Feb 26, 2023
@tomayac
Copy link
Member

tomayac commented Feb 26, 2023

You’re right, this isn’t working as intended.

I think there’s a return 'showOpenFilePicker(); missing right after

top.location + '';

I’ll properly test this after the weekend.

@tomayac
Copy link
Member

tomayac commented Feb 27, 2023

My brain was in weekend mode. Your suggestion was correct. I have also simplified this, since it still had artifacts of the previous version of the File System Access API. I have also added the different iframes to the demo. Thanks again for filing this.

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

No branches or pull requests

2 participants