Feature policy can be defined for browsing context , but there is no way to define it for script context. I think it’s totally wrong, and there is an objective need to be able to run different scripts in different script contexts (with different global environments and different set of available browser features / Web APIs). Example: I need to run two scripts on a webpage. The first script is a first-party script that will access sensetive data (or fingerprintable API’s). The second script is a third-party script that will make some network requests. I need to isolate these scripts from each other to ensure that the second script will never have access to sensetive data. But now there is no way to do it. I tried to create a model that can describe script contexts and any browser feature that can be used, maybe someone will find it helpful: https://pastebin.com/EGBX5Z5G
Note: see also https://github.com/WICG/feature-policy/issues/238