I believe this is an issue that is related to the bfcache (back-forward cache) in Chrome 79 as this wasn't an issue in Chrome 78. The code below demonstrates the issue when using the latest version of Chrome on Windows 10.
<html>
<head>
<title>Test Page</title>
</head>
<body>
<h1>Test Page</h1>
<select id="example" multiple>
<option>Black</option>
<option>Cyan</option>
<option>Magenta</option>
<option>Yellow</option>
</select>
<a href="https://www.google.com/">Google</a>
<script type="text/javascript">
window.onpageshow = function () {
//setTimeout(function () {
console.log(document.querySelectorAll('#example option:checked').length);
//}, 100);
};
</script>
</body>
</html>
Select items in the dropdown and then navigate away from the page using the hyperlink and when returning to the page by pressing the browser back button the previously selected items aren't reflected in the pageshow event but are on the webpage.
The only way I was able to workaround this was to set a short timeout (see commented out code). Anyway I'm hoping someone reading this is able to reproduce in Chrome 79 and if so, suggest the best way to resolve the issue.