Here’s how Filament Group enhances (or: used to) their website for browsers that “Cut the Mustard”:
if( "querySelector" in window.document && "addEventListener" in window ){
// This is a capable browser, let's improve the UI further!
window.document.documentElement.className += " enhanced";
// load the enhanced scripting
loadJS( "/path/to/enhancements.js" );
}
But what if a browser is “Cutting the Mustard”, but the connection (or a content blocker) is preventing the extra scripts from being loaded? Time to adjust the base logic, and build some fault tolerance into it.