Skip to content

Commit

Permalink
fixup! Chore: Handling CORS on Netlify
Browse files Browse the repository at this point in the history
  • Loading branch information
curdaj committed Nov 27, 2024
1 parent ee5afb4 commit 420bb21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/demo/partials/layout/base.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
targetElement.classList.add(`theme-${theme}`);
};
// Hide elements with hide-from-visual-tests class in Supernova preview
// Hide elements with hide-from-visual-tests class in Supernova preview with postMessage
window.addEventListener('message', (event) => {
// Check if the message is from the Supernova domain
if (event.origin === 'https://app.supernova.io') {
if (event.origin === 'https://app.supernova.io' || event.origin === 'https://cdpn.io') {
if (event.data.action === 'hide-from-visual-tests') {
const elements = document.querySelectorAll('.hide-from-visual-tests');
elements.forEach(el => {
Expand Down

0 comments on commit 420bb21

Please sign in to comment.