Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsemantic-release-bot <semantic-release-bot@martynus.net>2021-10-26 19:30:20 +0300
committersemantic-release-bot <semantic-release-bot@martynus.net>2021-10-26 19:30:20 +0300
commitb16cdf6c263633b268a0dd4930172d8eb8cb878e (patch)
tree4a0fc2e31b55e796d6d08b2c466d93c112fc8f37 /sw.min.js
parentba6b799ff614fedf26a29448620604aae3d2afec (diff)
chore(release): 1.5.8v1.5.8
## [1.5.8](https://github.com/webtorrent/webtorrent/compare/v1.5.7...v1.5.8) (2021-10-26) ### Bug Fixes * Prep for esm ([#2205](https://github.com/webtorrent/webtorrent/issues/2205)) ([ba6b799](https://github.com/webtorrent/webtorrent/commit/ba6b799ff614fedf26a29448620604aae3d2afec))
Diffstat (limited to 'sw.min.js')
-rw-r--r--sw.min.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw.min.js b/sw.min.js
index 2ab9107..54f86e1 100644
--- a/sw.min.js
+++ b/sw.min.js
@@ -1 +1 @@
-(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module){module.exports=event=>{const{request}=event,{url,method,headers,destination}=request;return url.includes(self.registration.scope+"webtorrent/")?url.includes(self.registration.scope+"webtorrent/keepalive/")?new Response:clients.matchAll({type:"window",includeUncontrolled:!0}).then(clients=>new Promise(resolve=>{for(const client of clients){const messageChannel=new MessageChannel,{port1,port2}=messageChannel;port1.onmessage=event=>{resolve([event.data,messageChannel])},client.postMessage({url,method,headers:Object.fromEntries(headers.entries()),scope:self.registration.scope,destination,type:"webtorrent"},[port2])}})).then(([data,messageChannel])=>{if("STREAM"===data.body||"DOWNLOAD"===data.body){let timeOut=null;return new Response(new ReadableStream({pull(controller){return new Promise(resolve=>{messageChannel.port1.onmessage=event=>{event.data?controller.enqueue(event.data):(clearTimeout(timeOut),controller.close(),messageChannel.port1.onmessage=null),resolve()},clearTimeout(timeOut),"STREAM"===data.body&&(timeOut=setTimeout(()=>{controller.close(),messageChannel.port1.postMessage(!1),messageChannel.port1.onmessage=null,resolve()},5e3)),messageChannel.port1.postMessage(!0)})},cancel(){messageChannel.port1.postMessage(!1)}}),data)}return new Response(data.body,data)}).catch(console.error):null}},{}],2:[function(require){const fileResponse=require("./worker-server");self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("fetch",event=>{const res=fileResponse(event);res&&event.respondWith(res)}),self.addEventListener("activate",evt=>{evt.waitUntil(self.clients.claim())})},{"./worker-server":1}]},{},[2]); \ No newline at end of file
+(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module){module.exports=event=>{const{request}=event,{url,method,headers,destination}=request;return url.includes(self.registration.scope+"webtorrent/")?url.includes(self.registration.scope+"webtorrent/keepalive/")?new Response:clients.matchAll({type:"window",includeUncontrolled:!0}).then(clients=>new Promise(resolve=>{for(const client of clients){const messageChannel=new MessageChannel,{port1,port2}=messageChannel;port1.onmessage=event=>{resolve([event.data,messageChannel])},client.postMessage({url,method,headers:Object.fromEntries(headers.entries()),scope:self.registration.scope,destination,type:"webtorrent"},[port2])}})).then(([data,messageChannel])=>{if("STREAM"===data.body||"DOWNLOAD"===data.body){let timeOut=null;return new Response(new ReadableStream({pull(controller){return new Promise(resolve=>{messageChannel.port1.onmessage=event=>{event.data?controller.enqueue(event.data):(clearTimeout(timeOut),controller.close(),messageChannel.port1.onmessage=null),resolve()},clearTimeout(timeOut),"STREAM"===data.body&&(timeOut=setTimeout(()=>{controller.close(),messageChannel.port1.postMessage(!1),messageChannel.port1.onmessage=null,resolve()},5e3)),messageChannel.port1.postMessage(!0)})},cancel(){messageChannel.port1.postMessage(!1)}}),data)}return new Response(data.body,data)}).catch(console.error):null}},{}],2:[function(require){const fileResponse=require("./worker-server.js");self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("fetch",event=>{const res=fileResponse(event);res&&event.respondWith(res)}),self.addEventListener("activate",evt=>{evt.waitUntil(self.clients.claim())})},{"./worker-server.js":1}]},{},[2]); \ No newline at end of file