To prevent archive list open new page and open content in current page, under Archive Block, something like this.
You can use this code to Page Header Injection (Page where you use Archive Block)
<script>document.addEventListener('DOMContentLoaded',function(){const tagLinks=document.querySelectorAll('.archive-group-name-link');const contentContainer=document.createElement('div');contentContainer.id='tag-content-display';contentContainer.style.cssText='margin-top: 20px; padding: 20px; border-top: 1px solid #ddd; display: none;';const archiveBlock=document.querySelector('.archive-block-wrapper');if(archiveBlock){archiveBlock.parentNode.insertBefore(contentContainer,archiveBlock.nextSibling)}
tagLinks.forEach(link=>{link.addEventListener('click',function(e){e.preventDefault();const tagUrl=this.href;contentContainer.innerHTML='<div style="text-align: center; padding: 20px;">Loading...</div>';contentContainer.style.display='block';fetch(tagUrl).then(response=>response.text()).then(html=>{const parser=new DOMParser();const doc=parser.parseFromString(html,'text/html');const blogItems=doc.querySelectorAll('.blog-item, .BlogItem, .summary-item');if(blogItems.length>0){let contentHTML='<h3>Posts for '+this.textContent+'</h3>';contentHTML+='<div class="tag-posts-container">';blogItems.forEach(item=>{const title=item.querySelector('h1, h2, h3, .blog-title, .BlogItem-title, .summary-title');const link=item.querySelector('a');const image=item.querySelector('img');contentHTML+='<div class="tag-post-item" style="margin-bottom: 20px; padding: 15px; border: 1px solid #eee; border-radius: 5px;">';if(image){contentHTML+='<img src="'+image.src+'" style="max-width: 100px; height: auto; float: left; margin-right: 15px;" />'}
if(title&&link){contentHTML+='<h4><a href="'+link.href+'">'+title.textContent+'</a></h4>'}
contentHTML+='<div style="clear: both;"></div></div>'});contentHTML+='</div>';contentHTML+='<button onclick="document.getElementById(\'tag-content-display\').style.display=\'none\'" style="margin-top: 15px; padding: 8px 16px; background: #333; color: white; border: none; cursor: pointer;">Close</button>';contentContainer.innerHTML=contentHTML}else{contentContainer.innerHTML='<p>No posts found for this tag.</p><button onclick="document.getElementById(\'tag-content-display\').style.display=\'none\'" style="margin-top: 15px; padding: 8px 16px; background: #333; color: white; border: none; cursor: pointer;">Close</button>'}}).catch(error=>{contentContainer.innerHTML='<p>Error loading content. Please try again.</p><button onclick="document.getElementById(\'tag-content-display\').style.display=\'none\'" style="margin-top: 15px; padding: 8px 16px; background: #333; color: white; border: none; cursor: pointer;">Close</button>';console.error('Error:',error)})})})});</script>

