From 60ba9d9d2fb4a069adb4fd25d9bf0151dfbbf524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=A9ng?= <99890979+maiminhdung@users.noreply.github.com> Date: Sat, 9 Aug 2025 12:48:43 +0700 Subject: [PATCH] Add fix CORS (Cross-Origin Resource Sharing) --- Auto-Farm.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Auto-Farm.js b/Auto-Farm.js index e1824d2..83e89dd 100644 --- a/Auto-Farm.js +++ b/Auto-Farm.js @@ -26,10 +26,10 @@ language: 'en' }; - // [NEW CODE] Global variable to store the captured CAPTCHA token. + // Global variable to store the captured CAPTCHA token. let capturedCaptchaToken = null; - // [NEW CODE] Intercept window.fetch to capture the 't' token from manual paints. + // Intercept window.fetch to capture the 't' token from manual paints. const originalFetch = window.fetch; window.fetch = async (url, options) => { if (typeof url === 'string' && url.includes('https://backend.wplace.live/s0/pixel/')) { @@ -80,7 +80,8 @@ const res = await fetch(`https://backend.wplace.live/s0/pixel/${CONFIG.START_X}/${CONFIG.START_Y}`, { method: 'POST', - headers: { 'Content-Type': 'text/plain;charset=UTF-8', 'credentials': 'include' }, + headers: { 'Content-Type': 'text/plain;charset=UTF-8' }, + credentials: 'include', body: JSON.stringify(payload) });