Skip to content

Commit

Permalink
add moveBefore support warning
Browse files Browse the repository at this point in the history
  • Loading branch information
OrionReed committed Dec 11, 2024
1 parent bb280ca commit da7e5ca
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions demo/moveBefore.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@
folk-shape {
background: rgb(187, 178, 178);
}

.warning-banner {
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: #fff3cd;
color: #856404;
border: 1px solid #ffeeba;
padding: 12px;
text-align: center;
z-index: 1000;
font-family: system-ui, -apple-system, sans-serif;
}
</style>
</head>
<body>
Expand All @@ -48,6 +62,11 @@

// Check for moveBefore support
if (!Element.prototype.moveBefore) {
const warning = document.createElement('div');
warning.className = 'warning-banner';
warning.innerHTML =
'⚠️ Note: moveBefore() API requires Chrome Canary with <code>chrome://flags/#atomic-move</code> enabled';
document.body.insertAdjacentElement('afterbegin', warning);
console.warn('Note: moveBefore() API requires Chrome Canary with chrome://flags/#atomic-move enabled');
}

Expand Down

0 comments on commit da7e5ca

Please sign in to comment.