diff --git a/src/ts/plugins/embedworker.ts b/src/ts/plugins/embedworker.ts index f7c172b4..6929b000 100644 --- a/src/ts/plugins/embedworker.ts +++ b/src/ts/plugins/embedworker.ts @@ -79,7 +79,7 @@ const whitelist = [ const evaluation = globaly.eval -const prop = Object.getOwnPropertyNames( globaly ) +const prop = Object.getOwnPropertyNames( globaly ).concat( Object.getOwnPropertyNames( this )) prop.push( //unsafe apis 'open', @@ -114,6 +114,16 @@ prop.forEach( function( prop ) { }); } catch (error) { } + try { + Object.defineProperty( this, prop, { + get : function() { + throw "Security Exception: cannot access "+prop; + return 1; + }, + configurable : false + }); + } catch (error) { + } } else{ }