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> | |
<style> | |
.error { | |
font-weight: bold; | |
color: red; | |
} |
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> | |
<script> | |
webLLMGlobal = {}; | |
</script> | |
<style> | |
.error { | |
font-weight: bold; |
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> | |
<script> | |
webLLMGlobal = {}; | |
</script> | |
<style> | |
.error { | |
font-weight: bold; |
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 lang="en"> | |
<head> | |
<title>Testing Sync XHR</title> | |
</head> | |
<body> | |
<h1>Testing <a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest_API/Synchronous_and_Asynchronous_Requests">Sync XHR</a></h1> | |
<div id="msg">This is the msg</div> |
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 lang="en"> | |
<head> | |
<title>Example DOAP embedded in HTML</title> | |
<script type="application/asf.doap+xml"> | |
<rdf:RDF xml:lang="en" | |
xmlns="http://usefulinc.com/ns/doap#" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:asfext="http://projects.apache.org/ns/asfext#" |
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> | |
<body> | |
<p>Load this page with <code>?ok=yes+it+works</code> to test it.</p> | |
<p>Search parameters: <b id="results"/></p> | |
<script> | |
const p = new URLSearchParams(window.location.search); | |
document.querySelector('#results').textContent = p.get('ok'); | |
</script> | |
</body> | |
</html> |
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
// List custom element names registered in the current browser page | |
console.log( | |
[...new Set([].map.call( | |
document.querySelectorAll('*'), | |
el => el.nodeName.toLowerCase())) | |
].filter( | |
customElements.get.bind(customElements) | |
) | |
.sort() | |
) |
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
// @ts-check | |
const { test, expect } = require('@playwright/test'); | |
test.beforeEach(async ({ page }) => { | |
await page.goto('https://demo.playwright.dev/todomvc'); | |
}); | |
const TODO_ITEMS = [ | |
'buy some cheese', | |
'feed the cat', |
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
// From https://web.dev/declarative-shadow-dom/ | |
// TODO do nothing in a browser that already supports declarative shadow DOM? | |
(function attachShadowRoots(root) { | |
root.querySelectorAll("template[shadowroot]").forEach(template => { | |
const mode = template.getAttribute("shadowroot"); | |
const shadowRoot = template.parentNode.attachShadow({ mode }); | |
shadowRoot.appendChild(template.content); | |
template.remove(); | |
attachShadowRoots(shadowRoot); | |
}); |
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 lang="en"> | |
<!-- Also stored at https://codepen.io/bdelacretaz/pen/OJEWQLO --> | |
<head> | |
<title>AEM Headless Adventures</title> | |
<style type="text/css"> | |
body { | |
font-family: -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif; | |
} |
NewerOlder