Created
March 30, 2021 22:02
-
-
Save ricealexander/9863fa3af31a5130d8f92f33fe403635 to your computer and use it in GitHub Desktop.
Determine which elements were persisted on Grove SPA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(()=> { | |
let blockLevelElements = [ | |
'address', 'article', 'aside', 'blockquote', 'canvas', 'dd', 'div', | |
'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', | |
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'li', 'main', | |
'nav', 'noscript', 'ol', 'p', 'pre', 'section', 'table', 'tfoot', | |
'ul', 'video' | |
] | |
const elements = document.querySelectorAll(blockLevelElements.join(',')) | |
for (let element of elements) { | |
element.dataset.tag = 'persisted' | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment