Limit window access to a module and its dependencies #40614
Unanswered
notmaintened
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Or let me know a way of achieving this, even if it involves addons
Essentially I want a way to let an imported module only access certain properties of the window object, and anything else really
For example
require('my-module')(['Math'])
So this module (and all modules it depends on) can only access window.Math and anything else is undefined
The example is using commonjs but you see what I'm asking, the above is just a silly syntax using a function, but I'm not aware how to approach that with addons if possible, or if there's a technical limitation
Edit: Just read the header post on discussions, please delete this post
Beta Was this translation helpful? Give feedback.
All reactions