Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Chrome extensions can't access the local filesystem so we have to start a tiny webserver in the background.

If someone knows a way around this limitation, or a simpler webserver to require / embed, I would be thrilled. But so far this is the best I've found.



Did you investigate requesting the files directly from the filesystem, like "file:///home/monkey/.js/google.com.js".

You'd need to tell users to enable file access for the extension though chrome://extensions/, since that isn't enabled by default and users have to opt into it. I also don't know if there is a way to get the current user's homedir without hardcoding it.

Also: you're being super careful to not allow arbitrary reading of the filesystem, right? A good sanity check would be to ensure that realpath() of any file served is under ~/.js before handing it off.


ahahahahah what? Dude, do you work for Microsoft? "Well see, we just have to run MS-SQL server (DESKTOP OMG EXPRESS ENGINE) here, and then we run IIS on top of it to serve this file listing..."


He co-founded GitHub and is the CEO presently. That will be good enough for you?


It's a limitation of Chrome. This isn't the first time that someone tried to use a local webserver to do something that Chrome doesn't allow. IIRC, there was someone that used a webserver to implement a hacky version of It'sAllText! for Chrome.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: