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

Open Folder Dialog Doesn't Work on WebGL #108

Open
GavinR621 opened this issue Jul 21, 2021 · 3 comments
Open

Open Folder Dialog Doesn't Work on WebGL #108

GavinR621 opened this issue Jul 21, 2021 · 3 comments

Comments

@GavinR621
Copy link

GavinR621 commented Jul 21, 2021

When attempting to open the folder dialog on WebGL, I get this error in my browser's JavaScript Console:
MethodAccessException: Attempt to access method 'SFB.IStandaloneFileBrowser.OpenFolderPanelAsync' on type '' failed.
Here's a screenshot:
image

I'm using Unity 2020.3.10f1

@GavinR621 GavinR621 changed the title Attempt to access method 'SFB.IStandaloneFileBrowser.OpenFolderPanelAsync' on type '' failed. [WebGL] File Dialog Doesn't Open on WebGL Jul 21, 2021
@GavinR621 GavinR621 changed the title File Dialog Doesn't Open on WebGL Open Folder Dialog Doesn't Open on WebGL Jul 22, 2021
@GavinR621 GavinR621 changed the title Open Folder Dialog Doesn't Open on WebGL Open Folder Dialog Doesn't Work on WebGL Jul 22, 2021
@HyTap
Copy link

HyTap commented May 18, 2022

I'm having the same issue. Any solutions?

@nerzid
Copy link

nerzid commented Aug 3, 2022

I have this issue too. It is weird that this issue hasn't been fixed for a year. It looks like this unity asset cannot be used in WebGL due to this issue atm.

@nerzid
Copy link

nerzid commented Aug 3, 2022

I have this issue too. It is weird that this issue hasn't been fixed for a year. It looks like this unity asset cannot be used in WebGL due to this issue atm.

It turns out this is not an issue with the asset but the "Example Usage" on the main page. Basically, you can't expect the File Browser to work on WebGL without using WWW for security sandbox reasons of unity. You also should use OnPointerDown interface and attach the script to the button that you want to open the file browser with instead of using onClick function of Button in inspector. Then it works!

There is already an example script for this here

Hope this helps someone.

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

3 participants