DOM
API for DOM manipulation in Seanime plugins. Each DOM operation involves communication between the plugin and the browser, so understanding performance considerations is important.
Core Methods
onReady
ctx.dom.onReady(() => {
console.log("DOM is ready...")
})onMainTabReady
query
queryOne
observe
createElement
asElement
DOM Element Methods
Content Methods
getText()
setText(text)
getAttribute(name)
getAttributes()
setAttribute(name, value)
removeAttribute(name)
hasAttribute(name)
Style Methods
setStyle(property, value)
getStyle(property?)
removeStyle(property)
hasStyle(property)
getComputedStyle(property)
CSS Class Methods
addClass(className)
hasClass(className)
DOM Traversal and Manipulation
before(sibling)
after(sibling)
remove()
getParent(opts?)
getChildren(opts?)
query(selector)
queryOne(selector)
Performance Best Practices
Minimize Roundtrips
Use observe() Efficiently
Last updated