JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript">
window.addEventListener('load', function() {
history.pushState(null, null, document.URL);
});
window.addEventListener('popstate', function(event) {
alert('test');
});
</script>
</head>
<body>
Navigate to this URL from another website and then click the <b>Back button</b> WITHOUT clicking or interacting with the document.
</body>
</html>