Mirror: A maybe slightly safer-ish wrapper around eval Function constructors
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

avoid chromium warning for Storage (#1)

* avoid chromium warning for Storage

* Update src/index.ts

Co-authored-by: Phil Pluckthun <phil@kitten.sh>

Co-authored-by: Phil Pluckthun <phil@kitten.sh>

authored by

Jovi De Croock
Phil Pluckthun
and committed by
GitHub
94964868 14645ba6

+8 -1
+8 -1
src/index.ts
··· 55 55 : Object.create(null); 56 56 // Copy all known keys over to the stand-in and recursively apply `withProxy` 57 57 // Prevent unsafe keys from being accessed 58 - const keys = ['__proto__', 'constructor'].concat(Object.getOwnPropertyNames(target)); 58 + const keys = ["__proto__", "constructor"]; 59 + try { 60 + // Chromium already restricts access to certain globals in an 61 + // iframe, this try catch block is to avoid 62 + // "Failed to enumerate the properties of 'Storage': access is denied for this document" 63 + keys.push(...Object.getOwnPropertyNames(target)); 64 + } catch (e) {} 65 + 59 66 for (let i = 0; i < keys.length; i++) { 60 67 const key = keys[i]; 61 68 if (