🇩🇪Germany @dreizwo

Account created on 30 November 2010, about 14 years ago
#

Recent comments

🇩🇪Germany dreizwo

Using sting cast instead of __toString() reflection.

🇩🇪Germany dreizwo

To have a simply reproducer - do following:

* Do a fresh install and enbale sitewide_alter as recommended.
* Enable automatic refresh
* Create a Node that should show an alert (add sitewide_alter and restrict to this node )
* add this snippet (f.x. with custom block ) somewhere on this site to simulate pushstate and history manipulation:

<div>
<h2> Client Side Navigation </h2>
<button onClick="push('/node/1')">Show alert</button>
<button onClick="push('/node/2')">Don't show alert - Push</button>
<button onClick="replace('/something/other')">Don't show alert - Replace</button>
<button onClick="history.back()">Back</button>
<button onClick="history.forward()">Forward</button>
</div> 

<script>
function push(url){
   history.pushState({"page": url}, '', url);
}
function replace(url){
   history.replaceState({"page": url}, '', url);
}

* render node/1

If the history is changed by any third party lib, the rendered alert is not dismissed or re-initialized until the automatic refresh is executed.

Unfourtunatly - if the history is changed by pushstate events - you will not receive a onpopstate event we could listen for. Therefore this patch contains a proxy based hook to dispatch a custom event.

After applying patch the alert is immediatly rendered/dismissed.

Production build 0.71.5 2024