Handling Custom URL Schemes in NW.js with registerProtocolHandler
Learn how to expose app‑specific URLs in NW.js using registerProtocolHandler, with a step‑by‑step example, timing tips, and security trade‑offs.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to expose app‑specific URLs in NW.js using registerProtocolHandler, with a step‑by‑step example, timing tips, and security trade‑offs.
NW.js uses its own V8/Node.js ABI distinct from standard Node.js. Build native addons by setting npm_config_target and npm_config_dist_url to NW.js artifacts, then verify loading with process.versions['node-webkit'] matching your build target.
NW.js blends Node.js and Chromium in one renderer, making preload scripts the only security boundary. Context isolation moves preloads to an isolated world, but native addons, webview inheritance, and Electron API gaps create real migration friction.
Enable Node.js in NW.js renderer windows, verify require() in DevTools, and package with nw-builder.
Use nwbuild to create platform installers from one project, then verify Node integration settings before shipping.
A diagnostic guide for NW.js apps that launch blank or fail with require is not defined, covering manifest checks, renderer probes, and native module fixes.
Enable Node integration in NW.js without exposing the full runtime to your renderer by combining context isolation with a preload-based API surface.
Build a folder-based NW.js package from scratch: configure package.json, enable Node require() in the renderer, verify the runtime in DevTools, and distribute an app.nw archive without breaking native module ABI compatibility.
NW.js merges Node.js and Chromium into one JavaScript context—letting you call require('fs') directly from HTML. That convenience reshapes threading, security, and distribution. A worked example shows the pattern and the pitfalls.