Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Proposal] Different script contexts with different feature policy. #238

Closed
moonyowl opened this issue Oct 28, 2018 · 3 comments
Closed

Comments

@moonyowl
Copy link

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).
Here is an 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.

@annevk
Copy link
Member

annevk commented Oct 29, 2018

That's basically not possible given how JavaScript works today.

@moonyowl
Copy link
Author

@annevk, It is possible to execute scripts in isolated context, and it's already implemented for browser extensions (content scripts).

  • Is it impossible to do the same for ordinary scripts?
  • Is it impossible to define feature policy for them?

@pabrai pabrai added this to New input in FP Engagement May 13, 2019
@pabrai pabrai moved this from New input to Proposed Features in FP Engagement May 13, 2019
@clelland
Copy link
Collaborator

Browser extensions are special, and there is currently no mechanism to allow this in HTML; if such a thing does arise, I suspect that policies will apply to those scripts, but I don't think Permissions Policy is the mechanism to enforce that isolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
FP Engagement
Proposed Features
Development

No branches or pull requests

4 participants