src/devtools/panel.js
/**
     * Update the filters stylesheet
     * @param   fromBuilder
     */
Update the filters stylesheet
@param   fromBuilder
Update the filters stylesheet @param fromBuilder
function updateFiltersStyles(fromBuilder = false) {
        let styleSheet = d.getElementById("filterStyles");
        clearStyles(styleSheet);
        console.log("providers", filters.providers);
        let hiddenProviders = Object.entries(filters.providers).filter((provider) => {
            return !provider[1] && (settings.providers[provider[0]].enabled);
        }).map((provider) => {
            return `.request[data-provider="${provider[0]}"]`;
        });
        if (hiddenProviders.length) {
            styleSheet.sheet.insertRule(`${hiddenProviders.join(", ")} { display: none; }`);
        }
        if (filters.account) {
            let filterMap = { "contains": "*", "starts": "^", "ends": "$", "exact": "" };
            styleSheet.sheet.insertRule(`.request:not([data-account${filterMap[filters.accountType]}="${filters.account}" i]) { display: none; }`);
        }
        if (filters.account || hiddenProviders.length) {
            d.body.classList.add("filters-active");
        } else {
            d.body.classList.remove("filters-active");
        }
    }
function updateFiltersStyles ( fromBuilder = false ) { let styleSheet = d . getElementById ( "filterStyles" ) ; clearStyles ( styleSheet ) ; console . log ( "providers" , filters . providers ) ; let hiddenProviders = Object . entries ( filters . providers ) . filter ( ( provider ) => { return ! provider [ 1 ] && ( settings . providers [ provider [ 0 ] ] . enabled ) ; } ) . map ( ( provider ) => { return ` ${ provider [ 0 ] } ` ; } ) ; if ( hiddenProviders . length ) { styleSheet . sheet . insertRule ( ` ${ hiddenProviders . join ( ", " ) } ` ) ; } if ( filters . account ) { let filterMap = { "contains" : "*" , "starts" : "^" , "ends" : "$" , "exact" : "" } ; styleSheet . sheet . insertRule ( ` ${ filterMap [ filters . accountType ] } ${ filters . account } ` ) ; } if ( filters . account || hiddenProviders . length ) { d . body . classList . add ( "filters-active" ) ; } else { d . body . classList . remove ( "filters-active" ) ; } }
Update the filters stylesheet
 @param   fromBuilder
Update the filters stylesheet @param fromBuilder
// Clear out any existing styles // Figure out what providers are hidden // Add hidden providers, if any // Add account filter, if applicable // Show the user that filters are (in)active