Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

mantou mantou132

🎯
Focusing
View GitHub Profile
@mantou132
mantou132 / serviceworker.js
Last active Jun 5, 2020 — forked from ngokevin/serviceworker.js
Service Worker Template - cache-else-network + network-else-cache
View serviceworker.js
const VERSION = '0.0.1';
const assetsToCache = [...new Set([self.location.pathname, '/'])].map(
path => self.location.origin + path,
);
self.addEventListener('install', () => {
self.skipWaiting();
self.caches.open(VERSION).then(cache => {
cache.addAll(assetsToCache);
View 宁波市专业监理工程师网络培训平台
document.querySelector('#videoVerifyContent').remove();
async function validator() {
const ocr = async url => {
const { default: Tesseract } = await import(
"https://dev.jspm.io/tesseract.js"
);
const data = await Tesseract.recognize(
url ||
"https://ware.cdeledu.com/cdel_ware/common/makeArithmeticCode.shtm?random=0.6212206602916508"
);