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

More feature policy ideas #24

Open
AshleyScirra opened this issue Jun 28, 2016 · 4 comments
Open

More feature policy ideas #24

AshleyScirra opened this issue Jun 28, 2016 · 4 comments

Comments

@AshleyScirra
Copy link

I think there is opportunity to use this feature to enforce best practices in web development and disable deprecated/inefficient/superseded features. This could help create a sort of "strict mode for HTML", whereby developers can set a HTTP header to encourage sensible design patterns. The no-docwrite is a good example of this. Here are some other ideas (from https://discourse.wicg.io/t/proposal-sandbox-policy/1414):

  • force-strict-mode: treat all scripts as if they had "use strict"; at the top, eliminating "sloppy mode" from the whole document
  • no-sync-storage to disable local/session storage (the old synchronous APIs superseded by IndexedDB) - the Chrome Web Store already implements this
  • no-prefixed-features - disable all prefixes, forcing standards-compliant uses only
  • no-nonstandard-features - similar to no prefixes, but to turn off all features not actually in the spec, e.g. window.orientation (replaced by screen.orientation), node.innerText (only exists for compatibility reasons), etc.
@ghost
Copy link

ghost commented Oct 24, 2016

The first one is redundant since modules will be strict by default.

@clelland
Copy link
Collaborator

@adria2, I think this proposal is to apply strict mode uniformly to all scripts included in a page; not specifically for module code.

@igrigorik igrigorik added this to the vNext milestone Nov 23, 2016
@laukstein
Copy link

What about policy to allow/disallow

  1. web-storage (like localStorage, sessionStorage, Indexed DB, window.Cache (from Service Worker))
  2. device viewport optimization (devices may auto apply different scaling optimizations for pages)

@Jamesernator
Copy link

Given feature policy seems to be about controlling access to features rather than changing them I think force-strict-mode would be better replaced with require-strict-mode which would prevent all forms of script execution that invokes tries to run non-strict code. This would include <script> but would also include things like importScripts(), eval, new Function, new Worker and so on.

@pabrai pabrai added the feedback label May 8, 2019
@pabrai pabrai added this to Feedback in FP Engagement May 13, 2019
@clelland clelland removed this from the vNext milestone Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

6 participants