-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
337 changed files
with
28,371 additions
and
693 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
*.iml | ||
.idea/* | ||
_site | ||
push-messaging-and-notifications/config.js | ||
push-messaging-and-notifications/manifest.json | ||
Gemfile.lock | ||
node_modules | ||
.DS_Store | ||
.idea/* | ||
.netlify | ||
.vscode/ | ||
*.iml | ||
*.pyc | ||
certificate.* | ||
dist/ | ||
Gemfile.lock | ||
node_modules | ||
push-messaging-and-notifications/config.js | ||
push-messaging-and-notifications/manifest.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
source 'https://rubygems.org' | ||
gem 'github-pages', '>=39' | ||
gem 'jekyll-sitemap' | ||
|
||
gem "webrick", "~> 1.7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Asynchronous Clipboard API Sample | ||
=== | ||
|
||
See https://googlechrome.github.io/samples/async-clipboard/index.html for a live demo. | ||
|
||
Learn more at https://www.chromestatus.com/feature/5861289330999296 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
textarea { | ||
display: block; | ||
border: 1px solid #555; | ||
padding: 5px; | ||
width: 16em; | ||
height: 3em; | ||
margin: 0 0 5px; | ||
font-size: 100%; | ||
} | ||
h4 { | ||
margin: 1em 0 0; | ||
} | ||
button { | ||
padding: 5px 10px; | ||
background: #666; | ||
border: 1px solid #333; | ||
border-radius: 5px; | ||
font-size: 100%; | ||
color: #fff; | ||
cursor: pointer; | ||
} | ||
button[data-permission] { | ||
position: relative; | ||
padding-left: 30px; | ||
text-align: left; | ||
} | ||
button[data-permission]:before { | ||
content: '...'; | ||
position: absolute; | ||
left: 5px; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
font-size: 120%; | ||
text-shadow: 0 0 1px rgba(0,0,0,0.5); | ||
} | ||
|
||
button[data-permission][data-state="granted"] { | ||
background: #495; | ||
border-color: #051; | ||
} | ||
button[data-permission][data-state="granted"]:before { | ||
content: '\2705'; | ||
} | ||
|
||
button[data-permission][data-state="denied"] { | ||
background: #945; | ||
border-color: #501; | ||
} | ||
button[data-permission][data-state="denied"]:before, | ||
button[data-permission][disabled]:before { | ||
content: '\1f6ab'; | ||
} | ||
|
||
button[data-permission][data-state="unavailable"] { | ||
background: #886a33; | ||
border-color: #493b21; | ||
opacity: .7; | ||
} | ||
button[data-permission][data-state="unavailable"]:before { | ||
content: '\1f47b'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** Write contents of the textarea to the clipboard when clicking "Copy" */ | ||
document.querySelector('#copy').addEventListener('click', () => { | ||
navigator.clipboard.writeText(document.querySelector('#out').value) | ||
.then(() => { | ||
ChromeSamples.log('Text copied.'); | ||
}) | ||
.catch(() => { | ||
ChromeSamples.log('Failed to copy text.'); | ||
}); | ||
}); | ||
|
||
/** Read from clipboard when clicking the Paste button */ | ||
document.querySelector('#paste').addEventListener('click', () => { | ||
navigator.clipboard.readText() | ||
.then(text => { | ||
document.querySelector('#out').value = text; | ||
ChromeSamples.log('Text pasted.'); | ||
}) | ||
.catch(() => { | ||
ChromeSamples.log('Failed to read from clipboard.'); | ||
}); | ||
}); | ||
|
||
/** Watch for pastes */ | ||
document.addEventListener('paste', e => { | ||
e.preventDefault(); | ||
navigator.clipboard.getText().then(text => { | ||
ChromeSamples.log('Updated clipboard contents: ' + text); | ||
}); | ||
}); | ||
|
||
/** Set up buttons to request permissions and display status: */ | ||
document.querySelectorAll('[data-permission]').forEach(btn => { | ||
const permission = btn.getAttribute('data-permission'); | ||
navigator.permissions.query({name: permission}) | ||
.then(status => { | ||
status.onchange = () => { | ||
btn.setAttribute('data-state', status.state); | ||
}; | ||
status.onchange(); | ||
}) | ||
.catch(() => { | ||
btn.setAttribute('data-state', 'unavailable'); | ||
btn.title = 'Permissions API unavailable.'; | ||
}); | ||
btn.addEventListener('click', () => { | ||
Promise.resolve().then(() => { | ||
return navigator.permissions.request({name: permission}); | ||
}) | ||
.then(status => { | ||
ChromeSamples.log('Permission: ' + status.state); | ||
}) | ||
.catch(err => { | ||
ChromeSamples.log('Permission request failed: ' + err); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
feature_name: Asynchronous Clipboard API | ||
chrome_version: 66 | ||
feature_id: 5861289330999296 | ||
local_css_files: ['demo.css'] | ||
--- | ||
|
||
<h3>Background</h3> | ||
<p>This is a demonstration of the text portions of the <a href="https://w3c.github.io/clipboard-apis/">Asynchronous Clipboard API</a>, shipping in Chrome 66.</p> | ||
<p><strong>Note:</strong> the permissions API requires that you enable the Experimental Web Platform Features flag in Chrome: <code>chrome://flags/#enable-experimental-web-platform-features</code></p> | ||
|
||
{% capture initial_output_content %} | ||
<textarea id="out" placeholder="Text to copy"></textarea> | ||
<button id="copy">Copy</button> | ||
<button id="paste">Paste</button> | ||
<h4>Permissions:</h4> | ||
<button data-permission="clipboard-read">Read</button> | ||
<button data-permission="clipboard-write">Write</button> | ||
{% endcapture %} | ||
{% include output_helper.html initial_output_content=initial_output_content %} | ||
|
||
{% include js_snippet.html filename='demo.js' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
feature_name: Auto Picture-in-Picture | ||
chrome_version: 73 | ||
feature_id: 5317876315586560 | ||
check_min_version: true | ||
manifest_url: manifest.json | ||
origin_trial: ArXErv6HQrbQCFv8abszkuUr5nijbvrEA9WZ6yrpvAkpfydlFelajq8jOn8lTYEdlBjG59iVqznGhjBs/GAhlwEAAAB3eyJvcmlnaW4iOiJodHRwczovL2dvb2dsZWNocm9tZS5naXRodWIuaW86NDQzIiwiZmVhdHVyZSI6IkF1dG9QaWN0dXJlSW5QaWN0dXJlIiwiZXhwaXJ5IjoxNTU5MDg3OTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZX0= | ||
--- | ||
|
||
<h3>Background</h3> | ||
<p> | ||
Web apps for video meetings will benefit by allowing picture-in-picture when | ||
users switch back and forth between web apps and other applications or tabs. | ||
This is currently not possible because a user gesture is required to enter | ||
picture-in-picture. | ||
</p> | ||
<p> | ||
To support these use cases, a new <code>autopictureinpicture</code> attribute | ||
is added to the list of content attributes for video elements. This feature | ||
applies only to Progressive Web Apps users have installed on Desktop. | ||
</p> | ||
<p> | ||
Note: In Chrome 73, it is <a | ||
href="https://developers.chrome.com/origintrials">available for trials</a> so | ||
that websites can use it without any experimental flag. | ||
</p> | ||
|
||
<style> | ||
video { background: #1e2327; border-radius: 4px; width: 100%; height: 360px; } | ||
</style> | ||
|
||
|
||
{% capture html %} | ||
<video id="video" autopictureinpicture></video> | ||
{% endcapture %} | ||
|
||
{% include html_snippet.html html=html %} | ||
{% include output_helper.html %} | ||
|
||
<script> | ||
if (!('pictureInPictureEnabled' in document)) { | ||
ChromeSamples.setStatus('The Picture-in-Picture API is not available.'); | ||
} else if (!document.pictureInPictureEnabled) { | ||
ChromeSamples.setStatus('The Picture-in-Picture API is disabled.'); | ||
} | ||
|
||
log = ChromeSamples.log; | ||
</script> | ||
|
||
<script> | ||
navigator.serviceWorker.register('service-worker.js'); | ||
</script> | ||
|
||
<script> | ||
window.addEventListener('appinstalled', function() { | ||
// Reload to trigger camera prompt if needed. | ||
location.reload(); | ||
}); | ||
</script> | ||
|
||
{% include js_snippet.html filename='index.js' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
if (window.matchMedia("(display-mode: browser)").matches) | ||
log('Warning! Install this sample app first.'); | ||
else { | ||
// If Progressive Web App is installed and running in a window, | ||
// request user camera and show its stream in the video. | ||
navigator.mediaDevices.getUserMedia({ video: true }) | ||
.then(stream => { | ||
video.srcObject = stream; | ||
return video.play(); | ||
|
||
// User can now show/hide window and video will enter and exit | ||
// automatically Picture-in-Picture when the document's visibility | ||
// changes. | ||
}); | ||
} | ||
|
||
video.addEventListener('enterpictureinpicture', function(event) { | ||
log('> Video entered Picture-in-Picture'); | ||
}); | ||
|
||
video.addEventListener('leavepictureinpicture', function(event) { | ||
log('> Video left Picture-in-Picture'); | ||
}); | ||
|
||
/* Feature support */ | ||
|
||
if (!('autoPictureInPicture' in HTMLVideoElement.prototype)) { | ||
log('Warning! Auto Picture-in-Picture is not available.'); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.