I released new code with better options. You can follow new instruction here.
To add Product Dimensions

into Product Description, like this.

Click Gear icon on Store Page

Click Advanced > Page Header Code Injection

Paste this code
<!-- @tuanphan - product dimensions -->
<script>
document.addEventListener("DOMContentLoaded",async()=>{const e=document.querySelectorAll(".product-description");if(e.length===0)return;const t=window.location.pathname+"?format=json-pretty";try{const a=await fetch(t),r=await a.json();if(r&&r.item&&r.item.variants&&r.item.variants.length>0){const t=r.item.variants[0],a=t.len||"",n=t.width||"",c=t.height||"",o=t.weight||"";e.forEach(s=>{const d=document.createElement("div");d.className="product-specs",d.innerHTML=`<p><strong>Length:</strong>${a}</p><p><strong>Width:</strong>${n}</p><p><strong>Height:</strong>${c}</p><p><strong>Weight:</strong>${o}</p>`,s.appendChild(d)})}}catch(e){console.error("Error fetching product JSON",e)}});
</script>
