Html file with jquery snippet to open local/NFS path works if opened directly in browser, but gives error if hosted via lightweight server

I have a lightweight html file with a jquery snippet to open a new browser tab with a local/NFS directory or folder path.

This works when I open the html file directly in my browser (edge/chrome)

image 1
image 2

But when I use a webserver like ‘serve’ (https://www.npmjs.com/package/serve) to host the html page on localhost, the jquery snippet fails and gives me an error – failed to load local resource.

image 3
image 4

Is there an underlying cross-origin issue due to which this happens?