You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param {boolean} isDebug - Whether in debug mode.
65
+
* @param {LCPMetric} metric - LCP Metric.
66
+
* @param {LogFunction} log - The function to call with log messages.
75
67
*/
76
-
functionhandleLCPMetric(metric,isDebug){
68
+
functionhandleLCPMetric(metric,log){
77
69
for(constentryofmetric.entries){
78
70
// Look only for LCP entries that have a URL and a corresponding element which is not an IMG or VIDEO.
79
71
if(
@@ -98,36 +90,26 @@ function handleLCPMetric( metric, isDebug ) {
98
90
99
91
// Skip URLs that are excessively long. This is the maxLength defined in image_prioritizer_add_element_item_schema_properties().
100
92
if(entry.url.length>500){
101
-
if(isDebug){
102
-
log(`Skipping very long URL: ${entry.url}`);
103
-
}
93
+
log(`Skipping very long URL: ${entry.url}`);
104
94
return;
105
95
}
106
96
107
97
// Also skip Custom Elements which have excessively long tag names. This is the maxLength defined in image_prioritizer_add_element_item_schema_properties().
108
98
if(entry.element.tagName.length>100){
109
-
if(isDebug){
110
-
log(
111
-
`Skipping very long tag name: ${entry.element.tagName}`
112
-
);
113
-
}
99
+
log(`Skipping very long tag name: ${entry.element.tagName}`);
114
100
return;
115
101
}
116
102
117
103
// Note that getAttribute() is used instead of properties so that null can be returned in case of an absent attribute.
118
104
// The maxLengths are defined in image_prioritizer_add_element_item_schema_properties().
0 commit comments