Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[demo][acl] Exclude multiple ACLs for global object properties #229

Closed
t2ym opened this issue Mar 6, 2018 · 0 comments
Closed

[demo][acl] Exclude multiple ACLs for global object properties #229

t2ym opened this issue Mar 6, 2018 · 0 comments

Comments

@t2ym
Copy link
Owner

t2ym commented Mar 6, 2018

[demo][acl] Exclude multiple ACLs for global object properties

Changes

  • ACL
  // 'window' in the main document, 'self' in workers
  const mainGlobalObjectName = typeof window === 'object' ? 'window' : 'self';
  const acl = {
    ...
    // ACLs for these global object properties are NOT applied for property access `window.property`
    // They are applied only for property access `window.top`, `window.parent`, ..., `window._global`
    top: 'r--',
    parent: 'r--',
    frames: 'r--',
    global: 'r--',
    self: 'r--',
    _global: 'r--',
    // Main global object ACL, actually window or self
    [mainGlobalObjectName]: { // overwrite self: in worker threads
      ...
    },
  };
  • Performance Optimization
    • _globalObjects.get(window) returns a Set object containing only 'window'
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant