diff --git a/README.md b/README.md index 08315dc..2adcaa5 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,30 @@ Cloudmoon InPlay is a simple site that proxies, hides, and loads cloudmoon in a [![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/sriail/Cloudmoon-InPlay) -## Use +## How It Works - Two-Phase System + +CloudMoon InPlay uses a **two-phase system** to allow both Google Sign-In AND game playing: + +### Phase 1: Direct Mode (Sign In) +When you first open the site, it loads CloudMoon **directly** (not through the proxy). This allows Google Sign-In to work normally because the browser connects directly to `web.cloudmoonapp.com`. -> [!IMPORTANT] -> Because of google's authentication policies, the google sign in button will NOT WORK. You must hit sign in with email and password instead. You will also need to register your cloudmoon account at home with google and set a password in settings. +### Phase 2: Proxy Mode (Play Games) +After signing in, click the **"Enable Proxy"** button to switch to proxy mode. This routes all traffic through the Cloudflare Worker, which: +- Bypasses network restrictions +- Injects game interception code so games open in the same window +- Keeps you logged in (session persists) + +## Use -Once you sign in, you can click and play games in Cloudmoons library! -After that, you can use the upper navbar to help you navigate, cloak the site with About:Blank, and reload the site with the reload button. +1. **Sign in first**: Use Google Sign-In while in Direct Mode (green "Enable Proxy" button) +2. **Enable Proxy**: Click the "Enable Proxy" button to switch to Proxy Mode (purple "Proxy Mode" button) +3. **Play games**: Browse and click on games - they will open in the same window +4. **Use the Back button**: Return to the game library after playing +> [!TIP] +> The status bar shows which mode you're in: +> - "Direct Mode - sign in works!" = Use Google Sign-In here +> - "Proxy Mode - games work!" = Play games here > [!NOTE] > When Cloudmoon tries to open a new Tab, it will open in the central iframe to avoid being blocked. diff --git a/worker.js b/worker.js index e696b0d..786fba2 100644 --- a/worker.js +++ b/worker.js @@ -60,6 +60,8 @@ addEventListener('fetch', event => { newHeaders.delete('Content-Security-Policy'); newHeaders.delete('X-Frame-Options'); newHeaders.delete('Frame-Options'); + newHeaders.delete('Cross-Origin-Opener-Policy'); + newHeaders.delete('Cross-Origin-Embedder-Policy'); const contentType = response.headers.get('Content-Type') || ''; @@ -71,10 +73,12 @@ addEventListener('fetch', event => { (function() { console.log('CloudMoon Interceptor Injected'); + // Intercept window.open for games const originalOpen = window.open; window.open = function(url, target, features) { console.log('Intercepted window.open:', url); + // Handle game URLs if (url && url.includes('run-site')) { console.log('Game URL detected!'); @@ -97,6 +101,8 @@ addEventListener('fetch', event => { return originalOpen.call(this, url, target, features); }; + console.log('CloudMoon Proxy Active - Game Interception Enabled'); + })(); `; @@ -206,6 +212,22 @@ addEventListener('fetch', event => { background: #238636; } + #proxy-btn { + background: #238636; + } + + #proxy-btn:hover { + background: #2ea043; + } + + #proxy-btn.proxied { + background: #6e40c9; + } + + #proxy-btn.proxied:hover { + background: #8957e5; + } + .icon { width: 16px; height: 16px; @@ -267,7 +289,13 @@ addEventListener('fetch', event => { CloudMoon InPlay -
Loading...
+
Sign in with Google first, then click "Enable Proxy"
+