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
Moved to https://github.com/ebidel/puppeteer-examples/blob/master/lighthouse/chromelauncher_puppeteer.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
Now at https://github.com/ebidel/puppeteer-examples/blob/master/lighthouse/throttling.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
Moved to https://github.com/ebidel/puppeteer-examples/blob/master/monitor_internet_connection.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
/** | |
* @author ebidel@ (Eric Bidelman) | |
* License Apache-2.0 | |
*/ | |
// Prints the bytes cached by service worker. Breaks out each cache | |
// overall in-memory bytes used by the Cache Storage API for the site. | |
async function getCacheStoragesAssetTotalSize() { | |
// Note: opaque (i.e. cross-domain, without CORS) responses in the cache will return a size of 0. |
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
<!-- | |
Complete feature detection for ES modules. Covers: | |
1. Static import: import * from './foo.js'; | |
2. Dynamic import(): import('./foo.js').then(module => {...}); | |
Demo: http://jsbin.com/tilisaledu/1/edit?html,output | |
Thanks to @_gsathya, @kevincennis, @rauschma, @malyw for the help. | |
--> |
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
(function() { | |
const scroller = document.scrollingElement || document.body; | |
// Smooth scrolls to the bottom of the page. | |
window.smoothScrollPage = (y = scroller.scrollHeight) => { | |
scroller.style.scrollBehavior = 'smooth'; | |
scroller.scrollTop = y; | |
scroller.style.scrollBehavior = ''; | |
}; |
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
'use strict'; | |
customElements.define('x-hello', class extends HTMLElement { | |
static get observedAttributes() { | |
return ['name']; | |
} | |
constructor() { | |
super(); | |
} | |
attributeChangedCallback(attrName, oldVal, newVal) { |
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
/** | |
* @author ebidel@ (Eric Bidelman) | |
* License Apache-2.0 | |
*/ | |
/** | |
* Convenience method finding all the DOM child nodes of a parent, | |
* includibg those within shadow roots. By default, all children | |
* under `<body>` will be returned. The parent node can be overridden | |
* by passing the `selector` param. |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> | |
<title>How to use the Custom Elements v1 + Shadow DOM v1 polyfills</title> | |
<style> | |
body { | |
font-family: sans-serif; |
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
<html> | |
<head> | |
<title>Polymer example</title> | |
<link href='https://fonts.googleapis.com/css?family=Playfair+Display' rel='stylesheet' type='text/css'> | |
<script> | |
// Enable native SD if available and lazy register. | |
window.Polymer = window.Polymer || { | |
dom: 'shadow', | |
lazyRegister: 'max', | |
useNativeCSSProperties: true |