A very small and lightweight library for detecting the Replit Webview and fullscreen modes.
Is in Webview:
Is in fullscreen:
Include the following script in your page:
<!-- load the Webview detector library -->
<script src="https://replit-webview-detector.pages.dev/webview-detector.js"></script>
Then, to detect if you're inside the Webview in the Replit workspace, use the following:
const detector = new ReplitWebviewDetector();
// detect Replit Webview
detector.isWebview();
If you want to detect fullscreen, use the following:
// detect fullscreen mode
detector.isFullScreen();
Fullscreen is when the page is opened in it's own tab, and is the topmost window.