Open file:// URI to specific # (hash) ID

File scheme (file://) just doesn’t support anchors or actually any parameters, according to RFC. So query string, anchors or anything else besides path to file can be ignored by whatever processes url with this scheme, which is what happens here. If you try file:///C:/myFile.html?x=1 – query string will also be stripped. If on the other hand you’ll try then it will open exactly this url in browser, because other scheme.

So I’d say it works as expected and your workaround is fine.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top