forked from remixz/umi
-
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.
* Proxy Crunchyroll CDN through Netlify Allows us to bring back thumbnails on the scrubber and no more HTTPS errors * Add status code to cdn proxy on Netlify * Reorder cdn proxy rule * Fix proxy rule again * Rewrite video poster URL * Proxy rule needs the 200 * Move BIF parser to a web worker * Move CRUNCHYROLL_CDN constant to lib/cdnRewrite Not used by API, so we can avoid bundling that in the worker * Update dependencies and supported browsers I took a look at the analytics and found the majority of users are using very modern browsers. So, I updated all of the browsers in babelrc for the env preset (along with updating the preset itself for new data), and noticed that all of the supported browsers support async functions natively! Therefore, I don't need to include a polyfill for it anymore! :tada: * Don't cache /cdn/ URLs with the ServiceWorker * Fix syntax * Use ES5 syntax in webpack conf * Update Safari and iOS Safari versions to 11 Unfortunately Safari 10.x has a browser bug for async arrow functions nested inside another function (https://bugs.webkit.org/show_bug.cgi?id=166879) I could change the code not to use async arrow functions, but there are a few places where I am actually taking advantage of using `this`, and while I could just do some `const self = this` fun, I'd really rather not optimize for one browser version's bug. As well, looking at the analytics, in the past month only about 10 people out of 2136 used a Safari 10.x version. I apologize to those people who are losing support. Anyone who's on Mac and has a 10.x version can update to Safari 11 though, even without installing High Sierra! For those on iOS 10 and can't update because their device is too old... sorry! * Make guest-message transparent when hidden In Safari, the -50px margin at the top of the page is used in the background of the UI, so the UI would have a yellow background when scrolled down
- Loading branch information
Showing
16 changed files
with
424 additions
and
339 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/cdn/* http://img1.ak.crunchyroll.com/:splat 200 | ||
/appcache/* /index.html 404 | ||
/* /index.html 200 |
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
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
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
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
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
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
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
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
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
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,11 @@ | ||
const CRUNCHYROLL_CDN = 'http://img1.ak.crunchyroll.com/' | ||
|
||
export default function cdnRewrite (url) { | ||
if (typeof url !== 'string') return url | ||
|
||
if (url.indexOf(CRUNCHYROLL_CDN) > -1) { | ||
return url.replace(CRUNCHYROLL_CDN, '/cdn/') | ||
} else { | ||
return url | ||
} | ||
} |
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
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
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
Oops, something went wrong.