Closed futurist closed 3 years ago
It's not documented but you can use licia/stringifyAll and LunaObjectViewer.Static
to achieve your goal.
const stringifyAll = require('licia/stringifyAll')
const objectViewer = new LunaObjectViewer.Static(document.getElementById('container'))
const locationData = stringifyAll(location, {
unenumerable: true,
accessGetter: true,
timeout: 500
})
objectViewer.set(locationData)
Are there any possible to serialize the objects in Object Viewer, since sometimes there's a need to transport the output of Object Viewer eg. via
postMessage
as below:since some objects cannot be cloned via postMessage, but
JSON.stringify
will destroy the structure(eg. no getter/setter/prototype...), and ObjectViewer cannot serialize to HTML String now.Possible solution like serialize to v-dom objects that can safely transport via postMessage, then render the parent window to DOM.
Any idea this this?