Not sure which repository should I use for this issue, since it's dependent on using both. When used in combination with https://github.com/vojtech-dobes/history.nette.ajax.js, there is a bug in browser history titles in Google Chrome (oddly, FireFox handles it right).
When you use <title> tag as a snippet, document.title is changed prior to pushState call. That results in wrong title in Google Chrome history (long press on back button). Lets assume these steps:
Being on page with "Title 1".
Trigger AJAX call which invalidates title snippet, returning "Title 2" as its new content.
Extension snippets updates the title, so it's now "Title 2".
pushState from history.nette.ajax.js is called. First state in history is now titled "Title 2" (as it was last document.title of the page), the new one has the same title (as it is the current document.title).
I'm not sure how to approach this issue, since snippets has to updated before pushState call (because of UI cache) but title has to be unchanged until the pushState call. Moreover, when traversing back in history, the title stays unchanged if UI cache is turned off (I guess this might be treated as separate issue, but it may also be solved with this issue).
Not sure which repository should I use for this issue, since it's dependent on using both. When used in combination with https://github.com/vojtech-dobes/history.nette.ajax.js, there is a bug in browser history titles in Google Chrome (oddly, FireFox handles it right).
When you use
<title>
tag as a snippet,document.title
is changed prior topushState
call. That results in wrong title in Google Chrome history (long press on back button). Lets assume these steps:title
snippet, returning "Title 2" as its new content.snippets
updates the title, so it's now "Title 2".pushState
from history.nette.ajax.js is called. First state in history is now titled "Title 2" (as it was lastdocument.title
of the page), the new one has the same title (as it is the currentdocument.title
).I'm not sure how to approach this issue, since snippets has to updated before
pushState
call (because of UI cache) but title has to be unchanged until thepushState
call. Moreover, when traversing back in history, the title stays unchanged if UI cache is turned off (I guess this might be treated as separate issue, but it may also be solved with this issue).