
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
cherry-drag
Advanced tools
Improved window dragging for Electron applications.
Frameless windows can be dragged using the -webkit-app-region css property, but this disables all regular dom events and user interactions with the affected element, which makes it hard to emulate a native-like title bar in the application, as it's not possible to capture double clicks for maximizing the window.
A workaround is to use a pure javascript solution, but dragging only works well when moving the mouse in less than normal speed, else the mouse pointer will move outside the window area and no events will be received by the dom.
This module uses osx-mouse or win-mouse modules for tracking the mouse position on the entire screen, and thereby enabling consistent window dragging, while the affected element is still able to receive dom events.
The module needs to be built with the correct Electron headers. See the guide for using native Node modules with Electron for more information.
Versions of this library above version 2.0.0 require Electron which support Node.js version 9 and above.
npm install cherry-drag
Require the module in an Electron web page.
There are three things you need to do to migrate from the built-in module to .remote@electron/remote
First, you need to install it from NPM:
$ npm install --save @electron/remote
Second, must be initialized in the main process before it can be used from the renderer:@electron/remote/main
// in the main process:
require('@electron/remote/main').initialize()
var drag = require('cherry-drag')
// Pass a query selector or a dom element to the function.
// Dragging the element will drag the whole window.
var clear = drag('#element')
// Call the returned function to make the element undraggable again.
clear()
The module only works on OS X and Windows, but doesn't fail when installed on a non-supported platform.
// Fallback to using -webkit-app-region property.
if (!drag.supported) {
document.querySelector('#element').style['-webkit-app-region'] = 'drag'
}
FAQs
Window dragging for electron applications
We found that cherry-drag demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.