no-electron-webview-allowpopups
Disallow enabling allowpopups on Electron <webview> elements.
Targeted pattern scopeโ
Electron <webview> usage with allowpopups enabled.
What this rule reportsโ
JSX <webview> attributes that enable allowpopups.
Why this rule existsโ
Allowing popups from embedded untrusted content expands attack surface and abuse channels.
โ Incorrectโ
const view = <webview allowpopups src="https://example.com" />;
โ Correctโ
const view = <webview src="https://example.com" />;
ESLint flat config exampleโ
import sdl from "eslint-plugin-sdl-2";
export default [
{
plugins: { sdl },
rules: {
"sdl/no-electron-webview-allowpopups": "error",
},
},
];
When not to use itโ
Disable only if the embedded content is fully trusted and popup behavior is part of a reviewed application design.
Package documentationโ
Further readingโ
Rule catalog ID: R038