Application reloads to root (/) on every file change


#1

If I add a view or HTML file at public/another-page.html, and I open myglitch.glitch.me/another-page.html, and then I edit an HTML file, Glitch will change my other tag to go back to myglitch.glitch.me/. I’d expect to just do a simple reload to where I currently am at myglitch.glitch.me/another-page.html.


#2

hey ngokevin,

Sadly, this issue is a known browser limitation. The glitch editor window can open a window for you, but without injecting some code into your project, there’s no way the editor can know which page you’re currently at.

The reasons for this make sense from a browser maker perspective: if you go to amazon.com, ideally amazon shouldn’t know what you’re doing on yahoo(!).

We’d love to solve this, hopefully browsers allow our use case for this in the future.

In the meantime, my recommendation is that you disable auto refreshing and manually reload from the page you want after making some changes.


#3

Oops, thanks!

Another way for me was just to open a tab manually, rather than hit the Show.


#4

Regarding how to workaround this limitation, how about using some opt-in code that gives Glitch better control over the page?

E.g. I include a link to a Glitch script in my source code, and that allows a deeper integration with the Glitch editor. Would probably open up all sorts of interesting improvements.


#5

Hey Kayce, neat idea! I just put together the beginnings of such a thing here: https://glitch.com/edit/#!/glitch-fun-pack

It currently only does one thing: refresh the app on changes, without sending you back to the root URL.

Ideas for other stuff it could do would be awesome!


#6

Whoops I forgot to tag you in the previous comment @kaycebasques. :point_up: