This file contains hidden or 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"> | |
<title>Audio archive</title> | |
<style> | |
body { | |
font-family: helvetica,arial,sans-serif; | |
color: #333; |
This file contains hidden or 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
// see https://bugs.chromium.org/p/chromium/issues/detail?id=294514 for an explanation of the problem, with a very helpful automatic archival | |
// If you use this "code" you're going to burn in a very special level of hell. | |
// A level they reserve for child molesters and people who talk at the theater. | |
function engageManualScrolling(element) { | |
var start = 0; | |
var handleStart = function(event) { | |
start = element.scrollTop + event.touches[0].pageY; | |
}; |
This file contains hidden or 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
// MIT Licensed | |
// Author: jwilson8767 | |
/** | |
* Waits for an element satisfying selector to exist, then resolves promise with the element. | |
* Useful for resolving race conditions. | |
* | |
* @param selector | |
* @returns {Promise} | |
*/ |
This file contains hidden or 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 containerQuery(selector, test, stylesheet) { | |
var tag = document.querySelectorAll(selector) | |
var style = '' | |
var count = 0 | |
for (var i=0; i<tag.length; i++) { | |
var attr = (selector+test).replace(/\W+/g, '') |
This file contains hidden or 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
/** | |
* Runs "trigger" function after setting up MutationObserver and (optionally) Timeout | |
* that respectively resolve or reject the Promise. The resolve function gets an array | |
* (not NodeList) of elements that were added as argument. If the trigger function | |
* returns true the Promise is immediately resolved with an empty array, without waiting | |
* for a Mutation. | |
* | |
* @param {Function} trigger Function to run after setting up MutationObserver and Timeout. | |
* @param {Object} watch DOM Element to watch for Mutations. | |
* @param {string} [query=*] Selector query that elements added in the Observed Mutation must match. |
This file contains hidden or 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
/** | |
* A version of querySelectorAll() that also recursively looks into all shadow roots. | |
* @param selector Selector | |
* @param root (Optional) Scope of the query (Element or Document). Defaults to the document. | |
* @returns | |
*/ | |
function deepQuerySelectorAll(selector, root) { | |
root = root || document; | |
const results = Array.from(root.querySelectorAll(selector)); | |
const pushNestedResults = function (root) { |
OlderNewer