Fullscreen API Tester - Online Request & Exit Demo
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
UD5 Toolkit
Real-time detection, locking & debugging for device orientation
Lock the screen to a specific orientation. Requires user gesture & may need fullscreen on desktop.
Loading...
screen.orientation. The API exposes type (e.g., portrait-primary, landscape-primary) and angle (0°, 90°, 180°, 270°) properties, along with lock() and unlock() methods. This is especially useful for games, video players, and full-screen web apps that need to control display orientation.
screen.orientation.lock() method typically requires the document to be in fullscreen mode. If you attempt to lock orientation without fullscreen, you'll get a DOMException with a message like "lock() requires a fullscreen document". The solution is to first call document.documentElement.requestFullscreen(), then lock the orientation. This tool automatically attempts fullscreen when needed. On mobile devices, fullscreen is usually not required for orientation lock.
Note: The "primary" landscape direction may be 90° or 270° depending on the device manufacturer's convention. Most smartphones use 90° for landscape-primary.
lock() is limited — it typically works only in standalone PWA mode (Add to Home Screen) or when using webkit prefixes in some versions. Desktop Safari has limited support. Always check 'orientation' in screen before using the API. This tool automatically detects API availability and adjusts accordingly.
change event on screen.orientation:
screen.orientation.addEventListener('change', () => {
console.log('Orientation:', screen.orientation.type);
console.log('Angle:', screen.orientation.angle);
});
Alternatively, you can use the onchange property: screen.orientation.onchange = () => { ... }. The legacy window.orientationchange event is deprecated and should not be used in new projects.
allow="fullscreen" attribute for fullscreen requests, and allow="screen-orientation-lock" (or the legacy allow="orientation-lock") for orientation locking. Even with these permissions, some browsers may block orientation lock in cross-origin iframes. If you're embedding this tool, ensure the host page includes these permissions. The Permissions Policy header can also affect this: Permissions-Policy: screen-orientation-lock=(self).
lock('any') allows the screen to freely rotate to any orientation (portrait or landscape, primary or secondary) while technically keeping a "lock" active — it effectively removes restrictions but maintains the lock state. unlock() completely releases the lock, returning orientation control to the system default behavior. In practice, both result in free rotation, but lock('any') keeps the lock promise resolved, while unlock() fully releases it. Use unlock() when you're done controlling orientation.
document.documentElement.requestFullscreen(). Desktop browsers enforce this.portrait-secondary) is not supported by the device or browser. Fall back to portrait or landscape.'orientation' in screen. If false, the browser doesn't support this API. Consider using a polyfill or accepting the limitation.screen.orientation changes. For testing lock() on desktop, enter fullscreen mode first (use the Fullscreen button in this tool), then lock — Chrome desktop supports this combination. Firefox also supports orientation lock in fullscreen.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
Generate a pop signal to determine if speakers are wired in phase. Quick stereo test.
Display an astigmatism dial and instructions for self-assessment. Educational, not a medical diagnosis.
Hear a word spoken by browser TTS and type the spelling. Choose difficulty or paste your own list. Great for kids. Local only.
Load a video and visually check if audio aligns with lips. Use frame‑by‑frame stepping. Debug playback issues.
Unified input demo: see pressure, tilt, and type from any pointer. Compare pointerType values. Essential for drawing apps.
Paste your Accept‑Language header and see which languages your site should serve based on quality values. Internationalization helper.
Test how your page loads under slow, 3G, or offline conditions by intercepting fetch and applying delays. No DevTools needed.
Decode an image progressively using the ImageDecoder API. See partial results and metadata. Modern alternative to <img>.
Decode individual video frames from a local file using the VideoDecoder API. Step through frames. Cutting‑edge browser feature.
Demonstrate how the Web OTP API automatically reads one‑time codes from SMS (mobile). Simulation with a fake SMS input.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Connect a gamepad and see all button presses and axis movements visually. Check that every input is detected correctly.
Trigger different vibration patterns on mobile devices. Test if your phone supports haptic feedback. Simple demo.
See your device's battery level, charging status, and discharge time using the Battery Status API. Fun utility.
Experiment with the Async Clipboard API: read/write text and images from the clipboard. Verify permissions and see demo code.
Test the Web Share API by sharing text, links, and files directly from the browser. Check compatibility and see example code.
Check if your browser and display support the wider DCI‑P3 color space. See the difference with a simple test pattern.
Enter an API URL and quickly check its HTTP status code and response time. See response headers and body. Browser fetch.
Generate random, formatted ID numbers that match pattern rules for various countries. For testing input validation. No real data.
Quickly test if your webcam, microphone, and speakers work correctly. See live video and audio meter. No data sent.
Generate random but realistic‑looking data arrays (users, products, orders) with typos and missing fields. For test robustness.
Simple interactive eye dominance test: hold up a virtual dot and see which eye stays aligned. Educational.
Build an iframe with different sandbox flags and see live which features are blocked. For secure embedding.
Simulate random mouse moves, clicks, or keystrokes to test idle‑timeout logic. Stops when you move the mouse. Dev test.
Paste a test card number to verify Luhn algorithm, identify issuer (Visa, MC), and check length. No real data.
Play left‑only, right‑only, and frequency sweeps to test your speakers or headphones. Quick audio check.
See a live VU meter of your microphone's input level. Test if your mic is working and adjust gain. Privacy‑friendly.
Generate random JSON data with customizable fields (users, products, orders). Useful for frontend mocking. All local.
Execute GraphQL queries against any endpoint with variables and headers. Explore schema via introspection. All requests made directly from your browser.