visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Improve support for the file protocol #441

Closed matthewp closed 6 years ago

matthewp commented 6 years ago

This change improves support for using the file protocol with page.js. Basically once you enable hashbang we treat the base as though it were /. Fixes #209

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.1%) to 90.0% when pulling 12e018964703dfaafe6ef1a5806d84a78615f8f4 on file-protocol into 12690357e66e9102889261fab7c7d69c0fb69392 on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.1%) to 90.0% when pulling 17e2695082c288a653c8efe1966b20e542e0885c on file-protocol into 12690357e66e9102889261fab7c7d69c0fb69392 on master.

kaisermann commented 5 years ago

@matthewp Sorry for commenting on an old PR, but could you explain what the location.protocol check here does in this context? I'm trying to save the last scroll position on page.exit (by using ctx.save) but my apps use the file: protocol and I'm unable to modify (and save) the current context before going to another one.

Edit: please tell me if this is not the right way to do this :grin: