-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
3,827 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// VV WPA support | ||
const CACHE_NAME = `Resonate`; | ||
|
||
// Use the install event to pre-cache all initial resources. | ||
self.addEventListener('install', event => { | ||
event.waitUntil((async () => { | ||
const cache = await caches.open(CACHE_NAME); | ||
cache.addAll([ | ||
'./Resonate.js', | ||
'./Resonate.wasm', | ||
'./index.html', | ||
'./icons/ResonateIcon.png', | ||
'./icons/ResonateIconLarge.png', | ||
'./icons/ResonateIconUnsaved.png', | ||
'./plugins/audiostretchworker.js', | ||
'./plugins/timestretch.js', | ||
'./public/plugins/RubberBand.js', | ||
'./public/plugins/RubberBand.js.mem', | ||
'./public/plugins/paulstretch.js', | ||
'./public/plugins/VexWarp/tools.js', | ||
'./public/plugins/VexWarp/stretch.js', | ||
'./public/plugins/VexWarp/require.js', | ||
'./public/plugins/VexWarp/main.js', | ||
'./public/plugins/VexWarp/jquery-2.0.3.js', | ||
'./public/plugins/VexWarp/dsp.js', | ||
]); | ||
})()); | ||
}); | ||
|
||
self.addEventListener('fetch', event => { | ||
event.respondWith((async () => { | ||
const cache = await caches.open(CACHE_NAME); | ||
|
||
//const injectHeaders = (request)=>{ | ||
// const headers = new Headers(request.headers); | ||
// headers.set('Cross-Origin-Embedder-Policy', 'require-corp'); | ||
// headers.set('Cross-Origin-Opener-Policy', 'same-origin'); | ||
// const newRequest = new Request(request, { | ||
// mode: request.mode, | ||
// credentials: request.credentials, | ||
// headers: headers | ||
// }); | ||
// return newRequest; | ||
//}; | ||
|
||
// Get the resource from the cache. | ||
//const cachedResponse = await cache.match(event.request); | ||
//if (cachedResponse) { | ||
// return cachedResponse; | ||
//} else { | ||
try { | ||
// If the resource was not in the cache, try the network. | ||
//const fetchResponse = await fetch(injectHeaders(event.request)); | ||
const fetchResponse = await fetch(event.request); | ||
|
||
if(event.request.method != 'POST'){ | ||
// Save the resource in the cache and return it. | ||
cache.put(event.request, fetchResponse.clone()); | ||
} | ||
return fetchResponse; | ||
} catch (e) { | ||
// The network failed. | ||
const cachedResponse = await cache.match(event.request); | ||
if (cachedResponse) { | ||
return cachedResponse; | ||
} | ||
} | ||
//} | ||
})()); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!doctypehtml><html lang=en-us><head><meta charset=utf-8><meta content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"name=viewport><link crossorigin=use-credentials href=./manifest.json rel=manifest><title>Resonate</title><style>body{margin:0;background-color:#000}.emscripten{position:absolute;top:0;left:0;margin:0;border:0;width:100%;height:100%;overflow:hidden;display:block;image-rendering:optimizeSpeed;image-rendering:-moz-crisp-edges;image-rendering:-o-crisp-edges;image-rendering:-webkit-optimize-contrast;image-rendering:optimize-contrast;image-rendering:crisp-edges;image-rendering:pixelated;-ms-interpolation-mode:nearest-neighbor}</style><script>const default_console_log=console.log,default_console_warn=console.warn,default_console_error=console.error;fetch("/console",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"log",data:["Log server open"]})}).then((o=>{405!=o.status&&(console.log=(...o)=>{fetch("/console",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"log",data:o})}).then((()=>{}),(()=>{console.log=default_console_log,console.warn=default_console_warn,console.error=default_console_error})),default_console_log.apply(console,o)},console.warn=(...o)=>{fetch("/console",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"warn",data:o})}).then((()=>{}),(()=>{console.log=default_console_log,console.warn=default_console_warn,console.error=default_console_error})),default_console_warn.apply(console,o)},console.error=(...o)=>{fetch("/console",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"error",data:o})}).then((()=>{}),(()=>{console.log=default_console_log,console.warn=default_console_warn,console.error=default_console_error})),default_console_error.apply(console,o)})}))</script></head><body><canvas class=emscripten id=canvas onclick=_jsPrepPlayback() oncontextmenu=event.preventDefault()></canvas><script>var Module;(async()=>{Module={preRun:[],postRun:[],print:function(e){e=Array.prototype.slice.call(arguments).join(" "),console.log(e)},printErr:function(e){e=Array.prototype.slice.call(arguments).join(" "),console.error(e)},canvas:document.getElementById("canvas"),setStatus:function(e){console.log("status: "+e)},monitorRunDependencies:function(e){}},window.onerror=function(e,n,o,r,t){console.error("onerror: "+e.name+": "+e.message+"\n\t/bin/public/"+n.split("/").slice(-1)+":"+o+":"+r),console.error(t.stack),alert("OnError: \n"+e.name+": "+e.message)};{const e=await navigator.gpu.requestAdapter(),n=await e.requestDevice();Module.preinitializedWebGPUDevice=n}"serviceWorker"in navigator&&navigator.serviceWorker.register("./ResonateInstallWPA.js",{scope:"./"})})()</script><script src=plugins/timestretch.js></script><script src=https://apis.google.com/js/api.js async defer onload=""></script><script src=https://accounts.google.com/gsi/client async defer onload=""></script><script src=Resonate.js async></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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"lang": "en-us", | ||
"name": "Resonate", | ||
"short_name": "Resonate", | ||
"description": "A timing tool for ECHO", | ||
"start_url": "./", | ||
"background_color": "#5e5966", | ||
"theme_color": "#17141f", | ||
"orientation": "any", | ||
"display": "standalone", | ||
"icons": [ | ||
{ | ||
"src": "./icons/ResonateIconLarge.png", | ||
"sizes": "256x256" | ||
}, | ||
{ | ||
"src": "./icons/ResonateIconLarger.png", | ||
"sizes": "512x512" | ||
} | ||
] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.