Skip to content

Commit 286dbf1

Browse files
committed
Add feature to directly link max-age values
1 parent fc28cea commit 286dbf1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

max-age.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ can paste an existing `max-age` value and get its human-friendly equivalent.
183183
return parts.length > 0 ? parts.join(' and ') : '0 seconds';
184184
}
185185

186+
// Allow folk to hot-link a specific value
187+
const urlParams = new URLSearchParams(window.location.search);
188+
const valueParam = urlParams.get('value');
189+
if (valueParam && !isNaN(valueParam) && Number(valueParam) > 0) {
190+
const input = document.getElementById('jsInput');
191+
input.value = valueParam;
192+
calculateMaxAge();
193+
}
194+
186195
// Attach the input event listener with debounce
187196
document.getElementById('jsInput').addEventListener('input', debounce(calculateMaxAge, 300));
188197
</script>

0 commit comments

Comments
 (0)