npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cordova-plugin-edge-to-edge

v1.0.1

Published

A robust Cordova plugin designed to handle Android 15 (API 35+) edge-to-edge enforcement, display cutouts (notches)

Readme

cordova-plugin-edge-to-edge

NPM version Downloads License

A robust Cordova plugin designed to handle Android 15 (API 35+) edge-to-edge enforcement, display cutouts (notches), and system bar behaviors.

It automatically resolves the "blank safe area" and WebView offset issues, ensuring your Cordova application renders in true full-screen.

Features

  • Drop-in Solution: Automatically applies the edge-to-edge fix on application start (onload="true"), No JavaScript configuration is required for the basic fix.
  • Display Cutout Support: Renders content safely behind camera notches and punch-holes.
  • Advanced Insets API: Optionally retrieve accurate Safe Area, System Gestures, and Rounded Corners metrics.
  • Immersive Mode Control: Dynamically show or hide system bars (status bar and navigation bar).
  • Software Keyboard (IME) Detection: Real-time detection of keyboard visibility and height for layout adjustments.

Supported Platforms

  • Android (API 28+ for basic cutout support, optimized for API 35+)

🎉 View all plugin release notes

Installation

Install the plugin via Cordova CLI:

cordova plugin add cordova-plugin-edge-to-edge

Usage

By default, the plugin initializes automatically when the Android application boots.

It forces the WebView to ignore system window limits (FLAG_LAYOUT_NO_LIMITS), makes system bars transparent, and applies the SHORT_EDGES cutout mode.

For most applications, simply installing the plugin is enough.

Optional JavaScript API

For advanced control, the plugin exposes an optional JavaScript API under window.EdgeToEdge.

1. getSafeAreaInsets(successCallback, errorCallback)

Retrieves comprehensive metrics about the device's screen boundaries, including safe areas, gesture zones, and hardware rounded corners.

window.EdgeToEdge.getSafeAreaInsets(function(insets) {
    console.log("Safe Area Top: " + insets.top);
    console.log("Safe Area Bottom: " + insets.bottom);
    
    // Check if running in Cordova 15 (Android 15 Edge-to-Edge enforced)
    if (insets.isCordova15) {
        document.body.style.paddingTop = insets.top + 'px';
    }
}, function(error) {
    console.error(error);
});

Response Payload Example:

{
  "screen": {
    "width": 411,
    "height": 891,
    "widthPx": 1080,
    "heightPx": 2340
  },
  "top": 48,
  "bottom": 34,
  "left": 0,
  "right": 0,
  "systemGestures": {
    "top": 0,
    "bottom": 34,
    "left": 20,
    "right": 20
  },
  "roundedCorners": {
    "topLeft": 32,
    "topRight": 32,
    "bottomLeft": 32,
    "bottomRight": 32
  },
  "isCordova15": true
}

2. setImmersiveMode(options, successCallback, errorCallback)

Dynamically hides or shows the system bars (status bar and navigation bar). When hidden, system bars can be temporarily revealed by swiping from the edge.

// Hide system bars
window.EdgeToEdge.setImmersiveMode({ isImmersive: true }, onSuccess, onError);

// Show system bars
window.EdgeToEdge.setImmersiveMode({ isImmersive: false }, onSuccess, onError);

3. setCutoutMode(options, successCallback, errorCallback)

Adjusts how the window behaves around the display cutout (notch).

  • shortEdges (Default): Content renders into the cutout area on the short edges of the display.
  • never: Content never renders into the cutout area, potentially pushing the WebView down.
  • always: Content is always allowed to extend into the cutout areas.
  • default: Standard system behavior.
window.EdgeToEdge.setCutoutMode({ mode: 'shortEdges' }, onSuccess, onError);

4. getKeyboardState(successCallback, errorCallback)

Detects if the software keyboard (IME) is currently open and retrieves its height in pixels.

window.EdgeToEdge.getKeyboardState(function(state) {
    if (state.isVisible) {
        console.log("Keyboard height in pixels: " + state.heightPx);
        // Push your input fields up
    }
}, onError);

5. enableEdgeToEdge(successCallback, errorCallback)

Manually re-enables the edge-to-edge layout if it was previously disabled.

window.EdgeToEdge.enableEdgeToEdge(onSuccess, onError);

6. disableEdgeToEdge(successCallback, errorCallback)

Reverts the window layout limits to the Android default, respecting system boundaries and pushing content below the notch.

window.EdgeToEdge.disableEdgeToEdge(onSuccess, onError);

7. Event

document.addEventListener('edge.orientation.changed', function(event) {
    console.log("Screen rotated to: " + event.orientation);
    
    // Immediately fetch the new safe area insets to update UI margins
    if (window.EdgeToEdge) {
        window.EdgeToEdge.getSafeAreaInsets(function(insets) {
            console.log("New Insets after rotation: ", insets);
            
            // Example: If in landscape, the notch might now be on the left
            // document.body.style.paddingLeft = insets.left + 'px';
            // document.body.style.paddingTop = insets.top + 'px';
        }, function(error) {
            console.error(error);
        });
    }
}, false);

References & Related Projects

The layout behaviors and inset calculation logic implemented in this plugin are based on official guidelines and shared architecture from related projects:

License

This project is licensed under the MIT License.