We're building a site in which we will include vendor content and we also have students who code widgets that we include in our site. This may break our site when they modify the DOM
outside their widget's scope. Is there a way to give vendor content (or student's widgets) a sandbox other than an iFrame? Even web components
seem to allow traversing and modifying content outside their scope.
edit: Harris pointed me to this thread in the comments: Is It Possible to Sandbox JavaScript Running In the Browser?, this is basically what I have been looking for.
Edit: To the person marking this as a duplicate: ADSafe is one approach to this general question, but not specifically what I was asking for. I am asking for the options we have as developers, not how to use ADSafe nor am I having troubles getting it to work.