Rocky_Mountain_Vending/.pnpm-store/v10/files/22/945cc481c9e526c2e4c5d9b06a7f92242c08438ffe1e5c3d7141dd2640d4e19a2c7fb411fdb45b09e97698545d487963f57c57ceb89626e47641ac83fc8673
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

45 lines
1.1 KiB
Text

/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Tracks unused CSS rules.
*/
import BaseGatherer from '../base-gatherer.js';
class CSSUsage extends BaseGatherer {
/** @type {LH.Gatherer.GathererMeta} */
meta = {
supportedModes: ['snapshot', 'navigation'],
};
/**
* @param {LH.Gatherer.Context} context
* @return {Promise<LH.Artifacts['CSSUsage']>}
*/
async getArtifact(context) {
const session = context.driver.defaultSession;
const executionContext = context.driver.executionContext;
await session.sendCommand('DOM.enable');
await session.sendCommand('CSS.enable');
await session.sendCommand('CSS.startRuleUsageTracking');
// Force style to recompute.
// Doesn't appear to be necessary in newer versions of Chrome.
await executionContext.evaluate(() => window.getComputedStyle(document.body), {
args: [],
});
const {ruleUsage} = await session.sendCommand('CSS.stopRuleUsageTracking');
await session.sendCommand('CSS.disable');
await session.sendCommand('DOM.disable');
return ruleUsage;
}
}
export default CSSUsage;