gkngkc/UnityStandaloneFileBrowser

Open Folder Dialog Doesn't Work on WebGL

Opened this issue · 3 comments

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

I'm having the same issue. Any solutions?

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.

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.