neo4j-devtools / neo4j-bloom

A public repository for informal docs, problem reporting and content sharing related to Neo4j Bloom.
Apache License 2.0
18 stars 0 forks source link

Clickable external links do not work for file:// URI or other non-web URI schemes #41

Closed DavidSampson closed 4 months ago

DavidSampson commented 2 years ago

Bloom version: 2.1.1 OS: macOS Monterey 12.3.1

image

Properties named "link" correctly render as clickable URLs. However they only seem to actually work if the URL is a web URL (which opens the link in the default browser), they do not work for opening other sorts of links such as file:/// or even vscode:// etc. Clicking on one of these links does not appear to do anything at all, though they do appear as links with a pointer cursor and all.

GlacialBoy commented 2 years ago

Hello @DavidSampson !

For security reasons, the browser does not allow you to open a local file if that is represented as a html link. It will allow if you paste it directly in the url bar but not really if you embed that kind of url in a html anchor element.

I've tried it locally with Chrome and I got in the console.log this error Not allowed to load local resource: file:///Users/claudiogallina/Desktop/Screenshot%202022-04-01%20at%2009.08.07.png

Basically all the modern browser block this way of downloading the files ( File URL "Not allowed to load local resource" in the Internet Browser ) . A possible alternative is using a local web server and serve the file from there, in that case the file is not considered as local so the browser won't block you ( for example https://www.npmjs.com/package/http-server )

The extension vscode:// should open VSCode, if we use Bloom in the Browser it is working, the browser asks the user if you want to open the link. If you use it in Neo4j Desktop it is not working at all, it is a security limitation of Neo4j Desktop ( or Electron ). I hope this helps!

ckanz commented 4 months ago

Thanks for reaching out @DavidSampson! I will be closing this issue since it's been some time since the last reply. If you have any issues with Bloom, please feel free to raise a new issue here or on Canny https://neo4j-aura.canny.io/explore