mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-06 20:32:55 +08:00
feat: pages: add Cloudflare Web Analytics
This commit is contained in:
@@ -66,7 +66,8 @@ onMounted(async () => {
|
||||
await refresh();
|
||||
const token = import.meta.env.VITE_CF_WEB_ANALY_TOKEN;
|
||||
|
||||
if (token) {
|
||||
const exist = document.querySelector('script[src="https://static.cloudflareinsights.com/beacon.min.js"]') !== null
|
||||
if (token && !exist) {
|
||||
const script = document.createElement('script');
|
||||
script.defer = true;
|
||||
script.src = 'https://static.cloudflareinsights.com/beacon.min.js';
|
||||
|
||||
Reference in New Issue
Block a user