0

OK, so I have a quite odd application that is loading a js file which in turn updates the DOM of my page.

The js file is pretty much loading a view.

The problem I have is that it is not properly contained and is modifying the entire DOM (both the head and body for example)

So what I would like to keep this contained into one element. Is this possible without the use of iframes? and how bad would it be to use iframes?

is it perhaps possible to solve somehow with a shadow dom even if I can't modify the loaded js file?

asked Mar 5, 2019 at 8:42

1 Answer 1

1

Most likely not, unfortunately.

You could try and hack around things by monkey-patching in a new global document/window objects before loading the script, depending on how it does its thing, but nothing's guaranteed.

answered Mar 5, 2019 at 8:46
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.