Skip to content

Commit 84f6c11

Browse files
committed
add cloudflare
1 parent 9571124 commit 84f6c11

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

uninstall.html

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
1111
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
1212
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
13+
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
1314

1415
<style>
1516
.uninstall-hero {
@@ -357,7 +358,7 @@ <h1 class="uninstall-title">I'm sorry to see you go.</h1>
357358
<textarea class="fluent-textarea" name="entry.472098049"
358359
placeholder="Tell us more... (Optional)"></textarea>
359360
</div>
360-
361+
<div class="cf-turnstile" data-sitekey="0x4AAAAAAC8NIkPtzPtQxqM5" data-theme="light"></div>
361362
<div class="form-actions">
362363
<button type="submit" class="btn-primary">Submit Feedback</button>
363364
</div>
@@ -456,15 +457,22 @@ <h3>Back to Home</h3>
456457
});
457458
});
458459

459-
let submitted = false;
460-
form.addEventListener('submit', () => {
461-
submitted = true;
462-
// Troca o visual do botão para indicar carregamento
463-
const btn = form.querySelector('button[type="submit"]');
464-
btn.textContent = 'Sending...';
465-
btn.style.opacity = '0.7';
466-
btn.disabled = true;
467-
});
460+
form.addEventListener('submit', (e) => {
461+
// Busca a resposta do Cloudflare
462+
const turnstileResponse = document.querySelector('[name="cf-turnstile-response"]').value;
463+
464+
if (!turnstileResponse) {
465+
e.preventDefault(); // Impede o envio para o Google Forms
466+
alert("Por favor, complete a verificação de segurança.");
467+
return;
468+
}
469+
470+
submitted = true;
471+
const btn = form.querySelector('button[type="submit"]');
472+
btn.textContent = 'Sending...';
473+
btn.style.opacity = '0.7';
474+
btn.disabled = true;
475+
});
468476

469477
const iframe = document.getElementById('hidden_iframe');
470478
iframe.onload = function () {

0 commit comments

Comments
 (0)