Skip to content

Instantly share code, notes, and snippets.

View mattzeunert's full-sized avatar

Matt Zeunert mattzeunert

View GitHub Profile

Prefix in context:

{
  "@context": {
    "sch": "http://schema.org/"
  },
  "@type": "Event",
  "sch:name": "sth"
}

(Note that some of the changes are just due to variance.)

Cherry-picked reproducable results

The "Tools for web developers" title becomes visibility: hidden when you scroll down. Before axe had scrolled to the bottom of the page, so we didn't count it. But now we do and there's one more non-failing tap target.

tap-targets { score: '0.37 => 0.39', detailsItemCount: '17 => 17' }

self.addEventListener("install", async e => {
caches.open("v1").then(function (cache) {
return cache.addAll(["/app", "/app.css"]);
});
});
self.addEventListener("fetch", event => {
event.respondWith(
caches.match(event.request).then(cachedResponse => {
return cachedResponse || fetch(event.request);
function throttle (callback, limit) {
var wait = false;
return function () {
if (!wait) {
callback.apply(null, arguments);
wait = true;
setTimeout(function () {
wait = false;
}, limit);
}
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
var waitFor = async function waitFor(conditionFn, { timeout = 15000, checkInterval = 25, debugString = null, } = {}) {
if (typeof conditionFn !== "function") {
throw Error("waitFor condition argument isn't a function. Did you mean waitForElement?");
}
if (!debugString) {
debugString = conditionFn.toString();
}
let startedAt = new Date();
let conditionResult = await conditionFn();
while (!conditionResult) {