AlbertoPdRF / root-file-viewer

View ROOT files directly in VS Code!
https://marketplace.visualstudio.com/items?itemName=albertopdrf.root-file-viewer
MIT License
47 stars 5 forks source link

The browser doesn't show up when opening directly a file #1

Closed soleti closed 3 years ago

soleti commented 3 years ago

Hi! Amazing project, the TBrowser was the last thing that was keeping me from uninstalling ROOT :) However I have an issue: I can open the file from the Explorer, but if I open directly a ROOT file I get a blank screen.

AlbertoPdRF commented 3 years ago

Hi @soleti! Thanks for your kind words and for reporting the bug! I can indeed reproduce it, so I'm labeling the issue as a bug and will try to fix it soon

AlbertoPdRF commented 3 years ago

Ok, according to VS Code's Webview documentation:

By default, webviews can only access resources in the following locations:

  • Within your extension's install directory.
  • Within the user's currently active workspace.

So that's why ROOT files can't be opened directly but there's no problem when opening them from the explorer (i.e. when they are whithin the user's currently active workspace). The documentation also recommends that:

In general, webviews should be as restrictive as possible in loading local resources.

But I guess that in this particular case it would be fine to give access to any local resource?

By the way, after investigating, I'm not sure if this issue qualifies as a bug anymore but as a feature request instead, although that's not the important part

AlbertoPdRF commented 3 years ago

The new feature has been shipped in v0.1.0! 🎉