Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
markafoltz committed Oct 14, 2024
2 parents 2718296 + 8061592 commit 40a31d5
Show file tree
Hide file tree
Showing 337 changed files with 28,371 additions and 693 deletions.
Binary file added .DS_Store
Binary file not shown.
15 changes: 9 additions & 6 deletions .gitignore
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
2 changes: 2 additions & 0 deletions Gemfile
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"
3 changes: 3 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
</script>
{% assign sub_dirs = page.path | split: '/' | size | minus: 1 %}
{% capture relative_path_to_root %}{% for i in (1..sub_dirs) %}../{% endfor %}{% endcapture %}
{% if page.manifest_url %}
<link rel="manifest" href="{{ page.manifest_url }}">
{% endif %}
{% if page.icon_url %}
<link rel="icon" href="{{ page.icon_url }}">
{% else %}
Expand Down
6 changes: 5 additions & 1 deletion app-install-banner/basic-banner/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ <h1>Web App Install Banner: Basic Prompt Sample</h1>
<li>The manifest has a <code>short_name</code>, 144 pixel icon and a type of 'image/png'</li>
</ul>

<p>In this example you will see below a message indicating that the <code>beforeinstallprompt</code> event was fired.</p>

<pre id="output"></pre>

<p>To see if this example works, come back in another day and you will see the banner.</p>
<p>For testing we encourage you to force the banner to appear by setting the chrome://flags/#bypass-app-banner-engagement-checks flag.</p>
</body>
</head>
</html>
4 changes: 2 additions & 2 deletions app-install-banner/basic-banner/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ See https://googlechrome.github.io/samples/app-install-banner/basic-banner/index
#### Directions:

* Install Chrome, or another browser that supports Service Workers and manifest
* Visit the site over two separate days.
* Or, more usefully, enable chrome://flags/#bypass-app-banner-engagement-checks
* Visit the site over several minutes.
* Or, more usefully, enable chrome://flags/#bypass-app-banner-engagement-checks
2 changes: 1 addition & 1 deletion app-install-banner/cancelable-banner/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h1>Web App Install Banner: Cancel Prompt Sample</h1>
</p>

<ul>
<li>The app uses a <a href="http://www.html5rocks.com/en/tutorials/service-worker/introduction/">service worker</a></li>
<li>The app uses a <a href="https://developers.google.com/web/fundamentals/getting-started/primers/service-workers">service worker</a></li>
<li>The site is using HTTPS</li>
<li>The app has a manifest declared</li>
<li>The manifest has a <code>short_name</code>, 144 pixel icon and a type of 'image/png'</li>
Expand Down
4 changes: 2 additions & 2 deletions app-install-banner/cancelable-banner/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ See https://googlechrome.github.io/samples/app-install-banner/cancelable-banner/
#### Directions:

* Install Chrome, or another browser that supports Service Workers and manifest
* Visit the site over two separate days.
* Visit the site over several minutes.
* Or, more usefully, enable chrome://flags/#bypass-app-banner-engagement-checks

On the second vist, you will see a message on the page that says the event was cancelled.
On the second vist, you will see a message on the page that says the event was cancelled.
7 changes: 3 additions & 4 deletions app-install-banner/deferred-banner/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ <h1>Web App Install Banner: Defer prompt of banner sample</h1>

<p>Available in <a href="https://www.chromestatus.com/features/6560913322672128">Chrome 45+</a></p>

<p>The <a href="https://developers.google.com/web/updates/2014/11/Support-for-installable-web-apps-with-webapp-manifest-in-chrome-38-for-Android">web app install banner</a> will prompt the user to add your web app to the users home screen.
<p>The <a href="https://developers.google.com/web/fundamentals/engage-and-retain/app-install-banners/">web app install banner</a> will prompt the user to add your web app to the users home screen.
It will only prompt when a number of criteria have been met:
</p>

<ul>
<li>The app uses a <a href="http://www.html5rocks.com/en/tutorials/service-worker/introduction/">service worker</a></li>
<li>The app uses a <a href="https://developers.google.com/web/fundamentals/getting-started/primers/service-workers">service worker</a></li>
<li>The site is using HTTPS</li>
<li>The app has a manifest declared</li>
<li>The manifest has a <code>short_name</code>, 144 pixel icon and a type of 'image/png'</li>
Expand All @@ -43,7 +43,7 @@ <h1>Web App Install Banner: Defer prompt of banner sample</h1>
user clicks the button below. If the button below is disabled, Chrome has chosen now is not a good time to
show the prompt.</p>

<p>If the button is disabled, come back in another day and the button will be enabled.</p>
<p>If the button is disabled, come back in a few minutes and the button will be enabled.</p>

<p>For testing, we encourage you to force the button to be enabled by setting the
chrome://flags/#bypass-app-banner-engagement-checks flag.</p>
Expand All @@ -54,7 +54,6 @@ <h1>Web App Install Banner: Defer prompt of banner sample</h1>

<pre id=output></pre>


<script>
window.addEventListener('load', function() {

Expand Down
2 changes: 1 addition & 1 deletion app-install-banner/deferred-banner/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ See https://googlechrome.github.io/samples/app-install-banner/deferred-banner/in
#### Directions:

* Install Chrome, or another browser that supports Service Workers and manifest.
* Wait a day.
* Wait a few minutes.
* Or, enable chrome://flags/#bypass-app-banner-engagement-checks to enable the button right away.

Once the button is enabled, Chrome will display the Add to Home Screen prompt when you click it.
2 changes: 1 addition & 1 deletion app-install-banner/useraction-banner/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h1>Web App Install Banner: Detect User Install or Cancel of prompt sample</h1>

<pre id=output></pre>

<p>To see if this example works, come back in another day and you will see the banner.</p>
<p>To see if this example works, come back in a few minutes and you will see the banner.</p>
<p>For testing we encourage you to force the banner to appear by setting the chrome://flags/#bypass-app-banner-engagement-checks flag.</p>
</body>
</head>
4 changes: 2 additions & 2 deletions app-install-banner/useraction-banner/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ See https://googlechrome.github.io/samples/app-install-banner/useraction-banner/
#### Directions:

* Install Chrome, or another browser that supports Service Workers and manifest
* Visit the site over two separate days.
* Visit the site over several minutes.
* Or, more usefully, enable chrome://flags/#bypass-app-banner-engagement-checks

On the second vist, you will see a message on the page that says the user either installed the app or dismissed the banner.
On the second vist, you will see a message on the page that says the user either installed the app or dismissed the banner.
6 changes: 6 additions & 0 deletions async-clipboard/README.md
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
61 changes: 61 additions & 0 deletions async-clipboard/demo.css
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';
}
57 changes: 57 additions & 0 deletions async-clipboard/demo.js
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);
});
});
});
22 changes: 22 additions & 0 deletions async-clipboard/index.html
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' %}
61 changes: 61 additions & 0 deletions auto-picture-in-picture/index.html
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' %}
29 changes: 29 additions & 0 deletions auto-picture-in-picture/index.js
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.');
}
Binary file added auto-picture-in-picture/launcher-icon-0-75x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added auto-picture-in-picture/launcher-icon-1-5x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added auto-picture-in-picture/launcher-icon-1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added auto-picture-in-picture/launcher-icon-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added auto-picture-in-picture/launcher-icon-3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added auto-picture-in-picture/launcher-icon-4x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 40a31d5

Please sign in to comment.