Skip to content

Instantly share code, notes, and snippets.

@ricealexander
Created March 30, 2021 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricealexander/9863fa3af31a5130d8f92f33fe403635 to your computer and use it in GitHub Desktop.
Save ricealexander/9863fa3af31a5130d8f92f33fe403635 to your computer and use it in GitHub Desktop.
Determine which elements were persisted on Grove SPA
(()=> {
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