File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,18 @@ export default function (client: ScramjetClient) {
1515
1616 client . Proxy ( "URL.revokeObjectURL" , {
1717 apply ( ctx ) {
18- ctx . args [ 0 ] = unrewriteBlob ( ctx . args [ 0 ] ) ;
18+ setTimeout ( ( ) => {
19+ // scramjet rewrites blob urls to pass through the service worker first
20+ // this is neccesary if rewrites need to be applied to the blob
21+ // the issue is that if you call revokeObjectURL immediately after using the blob
22+ // the service worker will not have had time to download the blob
23+ // for some reason this is not an issue natively
24+ // simple delay is enough
25+ // TODO: find a way to make this not necessary
26+ ctx . args [ 0 ] = unrewriteBlob ( ctx . args [ 0 ] ) ;
27+ ctx . call ( ) ;
28+ } , 1000 ) ;
29+ ctx . return ( undefined ) ;
1930 } ,
2031 } ) ;
2132}
You can’t perform that action at this time.
0 commit comments