mirror of
https://github.com/eliasstepanik/vdo.ninja.git
synced 2026-01-11 13:48:38 +00:00
Add files via upload
This commit is contained in:
parent
cdcc9d4eb2
commit
5007bb029d
4
thirdparty/StreamSaver.js
vendored
4
thirdparty/StreamSaver.js
vendored
@ -30,7 +30,7 @@
|
||||
WritableStream: global.WritableStream || ponyfill.WritableStream,
|
||||
supported: true,
|
||||
version: { full: '2.0.7', major: 2, minor: 0, dot: 7 },
|
||||
mitm: 'https://steveseguin.github.io/StreamSaver.js/mitm.html?version=2.0.7'
|
||||
mitm: './thirdparty/mitm.html'
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,12 +46,14 @@
|
||||
iframe.src = src
|
||||
iframe.loaded = false
|
||||
iframe.name = 'iframe'
|
||||
iframe.id = "mitm_iframe"
|
||||
iframe.isIframe = true
|
||||
iframe.postMessage = (...args) => iframe.contentWindow.postMessage(...args)
|
||||
iframe.addEventListener('load', () => {
|
||||
iframe.loaded = true
|
||||
}, { once: true })
|
||||
document.body.appendChild(iframe)
|
||||
console.log(iframe);
|
||||
return iframe
|
||||
}
|
||||
|
||||
|
||||
12
thirdparty/mitm.html
vendored
12
thirdparty/mitm.html
vendored
@ -14,7 +14,10 @@
|
||||
when the worker then receives a stream then the worker will tell the opener
|
||||
to open up a link that will start the download
|
||||
-->
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
console.log("SERVER WORKING STARTED")
|
||||
// This will prevent the sw from restarting
|
||||
let keepAlive = () => {
|
||||
keepAlive = () => {}
|
||||
@ -81,13 +84,6 @@ function onMessage (event) {
|
||||
// redirect back to the page of who initiated a http request
|
||||
data.referrer = data.referrer || document.referrer || origin
|
||||
|
||||
// pass along version for possible backwards compatibility in sw.js
|
||||
data.streamSaverVersion = new URLSearchParams(location.search).get('version')
|
||||
|
||||
if (data.streamSaverVersion === '1.2.0') {
|
||||
console.warn('[StreamSaver] please update streamsaver')
|
||||
}
|
||||
|
||||
/** @since v2.0.0 */
|
||||
if (!data.headers) {
|
||||
console.warn("[StreamSaver] pass `data.headers` that you would like to pass along to the service worker\nit should be a 2D array or a key/val object that fetch's Headers api accepts")
|
||||
@ -167,3 +163,5 @@ if (navigator.serviceWorker) {
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user