wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

As a support agent, I want to be able skip specific LCP elements by selectors for diagnosis and patch issues

Open DahmaniAdame opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. In some occasions, investigating LCP issues requires excluding elements with conditions not yet supported by beacon logic.

Support needs a way to test exclusions and provide a quick fix for customers until the possible enhancement is added to the beacon.

Describe the solution you'd like Allow the beacon to skip specific selectors from LCP detection logic, like:

const excludedSelectors = ['.jeg_bg_overlay']; 
const lcpElements = Array.from(document.querySelectorAll( this.config.elements )).filter(element => {
    return !excludedSelectors.some(selector => element.matches(selector));
});

And add a filter hook to allow adding selectors to excludedSelectors to make it easy to apply temporary fixes on customer's websites.

Describe alternatives you've considered Manually change the beacon's code.

Additional context N/A

DahmaniAdame avatar Jun 11 '24 11:06 DahmaniAdame

related: https://secure.helpscout.net/conversation/2931971143/559287?viewId=377611

webtrainingwheels avatar May 09 '25 17:05 webtrainingwheels