For the specific case of Math, you could shadow the real Math object
with an object that merely inherits from the real one.  However, this
approach won't work for modifying prototypes of the built-in classes;
for example, modifying String.prototype can't be made to work this
way.

```
((Math) => {
  // do stuff that would modify Math
  // or use the modified Math
})(Object.create(Math))
```

It requires doing a source transform on the set of libraries you want
to use, but at least it's possible.

On Mon, Feb 12, 2018 at 11:35 AM, 'Kevin Reid' via Google Caja Discuss
<google-caja-discuss@googlegroups.com> wrote:
> On Sun, Feb 11, 2018 at 2:47 AM, Marc H <zappythe...@gmail.com> wrote:
>>
>> Is there any workaround, or way to give the guest script access to these
>> objects?
>
>
> No. Prohibiting such modifications is a central part of Caja's security
> strategy.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Google Caja Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-caja-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Mike Stay - metaw...@gmail.com
http://www.math.ucr.edu/~mike
http://reperiendi.wordpress.com

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-caja-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to