youtube / spfjs

A lightweight JS framework for fast navigation and page updates from YouTube
https://youtube.github.io/spfjs/
MIT License
2.23k stars 147 forks source link

Add configurable option make CSS loading blocking. #102

Open DavidCPhillips opened 9 years ago

DavidCPhillips commented 9 years ago

Currently CSS loading isn't blocking to SPF response processing as support is a bit iffy. Desktop support is decent, but mobile is a bit less thorough. It makes sense to be safer by default, but for sites with more CSS variation, we should allow blocking as an option.

Desktop support: Chrome 19, Safari 6, Firefox 9, Opera and IE 5.5 are supported.

Mobile: http://pie.gd/test/script-link-events/

nicksay commented 9 years ago

This one is tricky, since a unsupported browser will not fail gracefully as-is if we enable blocking on CSS loading.

One way to work around this would be to have a resource loading timeout after which processing is continued. If we implement this either with or without the timeout, we should be sure to indicate that using the option is "advanced" and subject to either risk or increase developer responsibility.

I think prefixing the config value with advanced-, providing no default value (just like we handle experimental-), and documenting the caveats would be important.