Open thatkookooguy opened 8 years ago
JSON Formatter core lib allows you to interact with the element. You can intercept clicks on links and fore it to open in a new window:
const formatter = new JSONFormatter({a:'http://github.com'});
const element = formatter.render();
element.addEventListener('click', event=> {
if (event.target.href) {
event.target.setAttribute('target', '_blank');
}
});
document.body.appendChild(element);
For your custom behavior you can use the core lib with above API to achieve what you are looking for.
thx a lot for the quick help!
love the library btw :-)
Currently, when clicking on urls (inside the compiled
json
), it triggers a navigation.Can you please add an option to open urls in a new window? or maybe make that the default behavior?