SpawnDomUri: Restrict to specific Dom-Node

151 Views Asked by At

I want to start some Isolate, which manipulates a specific area in my webpage. To achieve this, I create such an Isolate via the function SpawnDomUri, which is able to access the DomTree. Apparently, some malicious/erroneous Isolate may change the whole webpage, which may not be desirable.

So my question is:

Is it possible to restrict the access of a Dom-Isolate ( which is started via SpawnDomUri ) to a specific Dom-Node ( incl. ShadowRoots )?

Best Regards, Alex

2

There are 2 best solutions below

0
On

I don't think this is possible. I once saw an experiment from MS to try and allow this sort of sandboxing; but I don't believe it's something any major browsers have ability to do today.

Most people tend to use iframes to isolate them in this way (rightly or wrongly!).

3
On

The only solution that comes to my mind is to use a non-DOM-Isolate and expose an API on the root isolate that can be accessed by sending messages that only exposes/executes allowed invocations.
This is of course very cumbersome but as Danny said there is no direct support for your requirement.