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

Support propagating feature policy in popups. #170

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
958bece
Introduce Feature policy : document-stream-insertion
ehsan-karamad Jun 4, 2018
75812ee
Update document_stream_insertion.md
ehsan-karamad Jun 5, 2018
b52e879
Link {{Document}} in a few places
foolip Jun 18, 2018
debb98f
Export `Feature-Policy` as an HTTP header
foolip Jun 18, 2018
8945e72
Enable Travis to auto-build HTML output
clelland Jun 19, 2018
a99a693
Merge remote-tracking branch 'foolip/feature-policy-header'
clelland Jun 19, 2018
7ba9787
Add executable bit to deploy.sh
clelland Jun 19, 2018
0920ac5
Whitespace cleanup
clelland Jun 20, 2018
58a36d6
Switch to strings for En/Disabled values
clelland Jun 22, 2018
e9f14bb
Merge remote-tracking branch 'foolip/patch-2'
clelland Jun 27, 2018
ca24bf4
Merge branch 'patch-3' of https://github.com/ehsan-karamad/feature-po…
clelland Jun 27, 2018
f5690bc
Rename to document-write.md
clelland Jun 27, 2018
d97edb9
Add questionnaire for JS API
clelland Jul 4, 2018
1abf8ad
Add privacy and security section
clelland Jul 5, 2018
bdaad25
Merge pull request #185 from WICG/privacy-and-security
clelland Jul 9, 2018
3ce1e35
Fix broken links
Malvoz Jul 10, 2018
66c84b3
Merge pull request #186 from Malvoz/patch-1
clelland Jul 10, 2018
6d8bbbe
Update broken spec links
Malvoz Jul 10, 2018
b474a13
Merge pull request #187 from Malvoz/patch-1
clelland Jul 10, 2018
7f84fe6
Update reporting examples
clelland Jul 23, 2018
d1faae4
Add explainer for implementing sandbox through FP
clelland Jul 24, 2018
7aca81e
Add JavaScript introspection API (#184)
clelland Jul 24, 2018
37d974c
Fix out-of-date reference to features.md
clelland Jul 24, 2018
8200df6
Add privacy and security concerns with introspection api
clelland Jul 5, 2018
b7271ac
Remove vibrate feature
jpchase Jul 25, 2018
20ad55c
Merge pull request #192 from clelland/update-introspection-ps
clelland Jul 25, 2018
00b6e6a
Update security-privacy-questionnaire-introspection.md
clelland Jul 25, 2018
26c262f
Merge pull request #191 from jpchase/master
clelland Jul 25, 2018
4001ef2
Add Reporting section
paulmeyer90 Jul 12, 2018
22b78d9
Added definition for "violation", and algorithm to generate a report.
paulmeyer90 Jul 18, 2018
3625117
addressed comments
paulmeyer90 Jul 25, 2018
95e455d
Merge pull request #188 from paulmeyer90/reporting
clelland Jul 26, 2018
6a7bdc4
Explainer for 'lazyload' policy
ehsan-karamad Aug 1, 2018
b2a1dea
Remove 'vibrate', add link to features.md
Malvoz Aug 14, 2018
d16a378
Merge pull request #199 from Malvoz/master
clelland Aug 14, 2018
ea8085c
Reporting: fix typos
ebidel Aug 14, 2018
44c3858
Merge pull request #201 from ebidel/patch-1
clelland Aug 14, 2018
8872656
Update the 'lazyload' policy
ehsan-karamad Aug 16, 2018
a6cd8c9
Update lazyload.md
ehsan-karamad Aug 17, 2018
101c8d8
Fix typos
Malvoz Aug 31, 2018
fd3f576
Merge pull request #196 from ehsan-karamad/patch-4
clelland Aug 31, 2018
6b2cc49
Merge branch 'master' into Malvoz-patch-1
Malvoz Aug 31, 2018
4bc7e6d
Merge pull request #205 from Malvoz/Malvoz-patch-1
clelland Sep 4, 2018
8da951b
Remove report message (#217)
clelland Sep 13, 2018
f06cdfd
Merge almost duplicate parsing algorithms
clelland Sep 18, 2018
a7142ff
Update animations.md (#212)
ehsan-karamad Sep 20, 2018
99d812c
Add 'sync-xhr' to features.md
clelland Oct 3, 2018
f53266d
[lazyload.md] Correct parametric policy example (#210)
Malvoz Oct 4, 2018
43f44be
Fix typo allowusermediarequest => allowusermedia
clelland Oct 12, 2018
5c33cee
Update vertical_scroll.md (#232)
ehsan-karamad Oct 16, 2018
63bd4e5
Update the 'declared origin' algorithm. (#231)
clelland Oct 17, 2018
6aeb5d3
Fix inherited policy origin (#229)
clelland Oct 17, 2018
26e6c7f
Fix inherited policy calculation (#234)
clelland Oct 25, 2018
6e186dc
Updates to animations.md (#239)
ehsan-karamad Nov 5, 2018
4243115
Updating image policies (#240)
loonybear Nov 6, 2018
d2862c7
Remove integrations section. (#246)
clelland Nov 15, 2018
f234bf4
Fix a typo in features.md (#254)
morten-olsen Nov 22, 2018
fe4d07f
Remove allowusermedia from spec
clelland Nov 29, 2018
e6799ca
Remove unused spec link
clelland Nov 30, 2018
79721ff
Fix some broken references
clelland Nov 30, 2018
3c9afac
Merge branch 'master' into remove-allowusermedia
clelland Nov 30, 2018
7a11597
Merge pull request #257 from clelland/remove-allowusermedia
clelland Nov 30, 2018
6b9a076
Add support for popups
clelland Nov 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
index.html
deploy_key
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: python
python:
- '2.7'
env:
global:
- COMMIT_AUTHOR_EMAIL=travis-ci@w3.org
install:
- git clone --depth=1 --branch=master https://github.com/tabatkins/bikeshed.git ./bikeshed
- pip install pygments
- pip install --upgrade setuptools
- pip install --editable ./bikeshed
- bikeshed update
script:
- mkdir out
- bikeshed spec index.bs out/index.html
before_deploy:
- openssl aes-256-cbc -K $encrypted_b330ad4127a4_key -iv $encrypted_b330ad4127a4_iv
-in deploy_key.enc -out deploy_key -d
deploy:
provider: script
skip_cleanup: true
script: "./deploy.sh"
on:
branch: master
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Feature Policy

A web platform API which gives a website the ability to allow and deny the use of browser features in its own frame, and in iframes that it embeds. Examples of features that could be controlled by feature policy include:
A web platform API which gives a website the ability to allow and deny the use of browser features in its own frame, and in iframes that it embeds. Examples of [features](https://github.com/WICG/feature-policy/blob/master/features.md) that could be controlled by feature policy include:

- getUserMedia (Camera, Speakers and Microphone)
- Fullscreen
Expand All @@ -9,7 +9,7 @@ A web platform API which gives a website the ability to allow and deny the use o
- Payments
- Synchronous XHR
- Synchronous scripts
- Vibrate
- Lazyload
- ...

The spec is hosted on this repo, at https://wicg.github.io/feature-policy/
Expand Down
47 changes: 47 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
set -e # Exit with nonzero exit code if anything fails

# Expects that the build script will place the contents of gh-pages into out/.
# Expects that the before_deploy steps will place a deploy key in ./deploy_key.

TARGET_BRANCH=gh-pages

# Save some useful information
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
SHA=`git rev-parse --verify HEAD`

CLONED_TARGET_BRANCH=$(mktemp -d)
# Clone the existing gh-pages for this repo into out/
git clone --depth 1 --branch $TARGET_BRANCH $REPO $CLONED_TARGET_BRANCH

# Copy over the out/ directory, removing any old contents.
rsync -r --exclude .git --delete out/ $CLONED_TARGET_BRANCH

# Install the deploy key.
chmod 600 deploy_key
eval `ssh-agent -s`
if ! ssh-add deploy_key; then
echo "Unable to add SSH identity; exiting."
exit 1
fi

# Now let's go have some fun with the cloned repo
cd $CLONED_TARGET_BRANCH
# If there are no changes to the compiled out (e.g. this is a README update) then just bail.
if git diff --quiet; then
echo "No changes to the output on this push; exiting."
exit 0
fi

git config user.name "Travis CI"
git config user.email "$COMMIT_AUTHOR_EMAIL"

# Commit the "changes", i.e. the new version.
# The delta will show diffs between new and old versions.
git add -A .
git commit -m "Deploy to GitHub Pages: ${SHA}"

# Now that we're all set up, we can push.
git push $SSH_REPO $TARGET_BRANCH

Binary file added deploy_key.enc
Binary file not shown.
26 changes: 13 additions & 13 deletions features.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ of these features all belong in their respective specs.
|`payment`|`self`|Controls access to PaymentRequest interface.|
|`picture-in-picture`|`*`|Controls access to Picture in Picture.|
|`speaker`|`self`|Controls access to audio output devices.|
|`sync-xhr`|`*`|Controls whether synchronous XMLHttpRequest transfers are allowed.|
|`usb`|`self`|Controls access to USB devices.|
|`vibrate`|`self`|Controls access to `vibrate()` method.|
|`vr`|`self`|Controls access to VR displays.|

## Feature Definitions
Expand All @@ -31,7 +31,7 @@ of these features all belong in their respective specs.

The *autoplay* feature controls access to autoplay of media requested through the [HTMLMediaElement interface](http://w3c.github.io/html/semantics-embedded-content.html#htmlmediaelement).

If disabled in a document, then calls to [`play()`](http://w3c.github.io/html/semantics-embedded-content.html#dom-htmlmediaelement-play) without a user gesutre will reject the promise with a `NotAllowedError` DOMException object as its parameter. The [`autoplay`](http://w3c.github.io/html/semantics-embedded-content.html#dom-htmlmediaelement-autoplay) attribute will be ignored.
If disabled in a document, then calls to [`play()`](http://w3c.github.io/html/semantics-embedded-content.html#dom-htmlmediaelement-play) without a user gesture will reject the promise with a `NotAllowedError` DOMException object as its parameter. The [`autoplay`](http://w3c.github.io/html/semantics-embedded-content.html#dom-htmlmediaelement-autoplay) attribute will be ignored.

* The **feature name** for *autoplay* is "`autoplay`"
* The **default allowlist** for *autoplay* is `'self'`.
Expand Down Expand Up @@ -148,6 +148,15 @@ If disabled in a document, then calls to [`getUserMedia()`](https://w3c.github.i
* The **feature name** for *speaker* is "`speaker`"
* The **default allowlist** for *speaker* is `'self'`.

### sync-xhr

The *sync-xhr* feature controls whether synchronous requests can be made through the [XMLHttpRequest API](https://xhr.spec.whatwg.org/).

If disabled in a document, then calls to [`send()`](https://xhr.spec.whatwg.org/#the-send()-method) on `XMLHttpRequest` objects with the synchronous flag set will fail, causing a NetworkError DOMException to be thrown.

* The **feature name** for *sync-xhr* is "`sync-xhr`"
* The **default allowlist** for *sync-xhr* is `*`.

### usb

The *usb* feature controls whether the current document is allowed to use the [WebUSB API](https://wicg.github.io/webusb/).
Expand All @@ -157,20 +166,11 @@ If disabled in a document, then calls to the [`getDevices()`](https://wicg.githu
* The **feature name** for *usb* is "`usb`"
* The **default allowlist** for *usb* is `'self'`.

### vibrate

The *vibrate* feature controls whether the [Vibration API](https://w3c.github.io/vibration/) is allowed to cause device vibration.

If disabled in a document, then calls to the [`vibrate()`](https://w3c.github.io/vibration/#dom-navigator-vibrate) method should silently do nothing. If enabled, the browser may allow the device to vibrate.

* The **feature name** for *vibrate* is "`vibrate`"
* The **default allowlist** for *vibrate* is `'self'`.

### vr

The *vr* feature controls whether the current document is allowed to use the [WebVR API](https://w3c.github.io/webvr/spec/1.1/).
The *vr* feature controls whether the current document is allowed to use the [WebVR API](https://immersive-web.github.io/webvr/spec/1.1/).

If disabled in a document, then calls to the [`getVRDisplays()`](https://w3c.github.io/webvr/spec/1.1/#navigator-getvrdisplays-attribute) should return a promise which rejects with a SecurityError DOMException.
If disabled in a document, then calls to the [`getVRDisplays()`](https://immersive-web.github.io/webvr/spec/1.1/#navigator-getvrdisplays-attribute) should return a promise which rejects with a SecurityError DOMException.

* The **feature name** for *vr* is "`vr`"
* The **default allowlist** for *vr* is `'self'`.
Loading