Updated essential code placed in
Pastie Database:
Pastie Databasehttps://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=621To avoid the sensitivity of breaking when the CDN version is changed the code now matches on the relative path:
var
navCSSPath = "/css/themes/classic/nav.css";
if (event.request.url.match(
navCSSPath)) {...}
The code is
still sensitive to detecting the original and unmodified default color (
#74489D) but it is probably best to let the code fail and investigate and fix it until a best practice is developed (Earth is at the early stages of using
Service Workers with QuickBase). Reference:
var respModified = resp.replace(/
74489D/g, "6495ED");
In the future when QuickBase uses some type of
enhanced CSS build technology (LESS, SASS, PostCSS etc) there would probably be a more robust way to parse and substitute the
CSS with a
Service Worker. Actually I have no idea what QuickBase is dong with their
CSS during the build process but they must be doing something as the
CSS appears
minified.