From 692e9a990e837ff1b541c8a676df100970f74bd7 Mon Sep 17 00:00:00 2001 From: minggeorgelei <947967040@qq.com> Date: Wed, 25 Dec 2024 05:25:29 +0800 Subject: [PATCH] fix: the extension page will refresh after clicking the button. We need to add preventDefault to prevent form default behavior. (#1378) Co-authored-by: George --- api-samples/browsingData/popup.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api-samples/browsingData/popup.js b/api-samples/browsingData/popup.js index 61f7da2827..42b9047121 100644 --- a/api-samples/browsingData/popup.js +++ b/api-samples/browsingData/popup.js @@ -28,7 +28,8 @@ function parseMilliseconds(timeframe) { return null; } -function buttonClicked() { +function buttonClicked(event) { + event.preventDefault(); const option = document.getElementById('timeframe'); let selectedTimeframe = option.value; let removal_start = parseMilliseconds(selectedTimeframe);