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.
Turn your phone into a 3D compass using the AbsoluteOrientationSensor API. See quaternion and Euler angles in real time.
Connect a gamepad and see all button presses and axis movements visually. Check that every input is detected correctly.
Change text orientation within vertical writing mode. See mixed, upright, sideways. Useful for CJK layout.
Inject dynamic messages into ARIA live regions and monitor how they trigger screen reader announcements. Debug a11y.
Request permission and detect when the user is idle (away from keyboard). See screen lock state. For native‑like apps.
Simulate random mouse moves, clicks, or keystrokes to test idle‑timeout logic. Stops when you move the mouse. Dev test.
Select which pages to rotate left or right. Save the corrected PDF immediately. All local manipulation.
Test the Web Share API by sharing text, links, and files directly from the browser. Check compatibility and see example code.
Rotate an image by any angle with a live preview. Adjust background fill. Download the corrected orientation. Canvas‑based.
Rotate any JPEG or PNG by exact 90° increments or flip horizontally/vertically. Preserves original quality. Pure browser canvas.
Set up resources and processes and run the Banker's algorithm to check for safe states. Classic OS deadlock avoidance demo.
Click moving targets as fast as possible. Score time and accuracy. Fun benchmark.
Paste a Content‑Security‑Policy header and get a human‑readable breakdown. See potential risks and suggestions.
Watch for updates to aria‑live regions and log what a screen reader would announce. Debug live regions.
Enter any two of rise, run, pitch ratio, or angle to get the others. Useful for DIY shed or home projects.
Test the Content Indexing API to add a page to the device's content feed. See how your PWA integrates with the OS.
Paste or write a CSS gradient value and instantly see the rendered output. Debug and iterate on gradients quickly. Local preview.
Paste a list of numbers to visually check uniformity, mean, and simple pattern analysis. Educational tool for statistics and RNG.
Simulate a PWA receiving shared text, links, and images. Test the Web Share Target API without a server.
Check if the browser has captured the beforeinstallprompt event. Understand why your PWA is (or isn't) installable.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Shows a counter of how many seconds you have been idle. Tracks mouse and keyboard activity without recording.
Create a simple 3D bed-leveling test pattern (circles/squares) as a vector, preview, download SVG for extrusion.
Calculate how many rolls of wallpaper you need based on wall dimensions, roll size, and pattern repeat. Avoids overbuying. Simple and local.
Enter a URL and see its favicon at all standard sizes. Check if it's properly defined. SEO basic check.
Check if the current page can be loaded offline by examining the service worker cache. Developer tool for PWAs.
Enter a URL and fetch its text/background colors to perform a bulk contrast check. See warnings for WCAG violations.
Test how your page loads under slow, 3G, or offline conditions by intercepting fetch and applying delays. No DevTools needed.
Add web content to the device’s content index (like Google Discover). See the indexed items and delete them.