Popup Window Code Generator
WebEverything runs locally in your browser — nothing is uploaded
Enter a URL, set the size, position and a few switches, and get code you can paste. Half the value here is telling you which parameters no longer do anything: `menubar`, `toolbar`, `location` and `status` are ignored by modern browsers (neither Chrome nor Firefox lets a script hide the address bar — that is anti-phishing design), so copying a “menubar=no” snippet only makes you think it worked. The other half is safe defaults: when `window.open` opens a same-origin page, the new window can reach back through `window.opener` and navigate the page that opened it, so the generated code adds `noopener` and clears `opener`.
Features
- Outputs window.open code or an `<a target="_blank">` link
- Adjustable size, position, resizability and scrollbars, with out-of-range values clamped
- Does not emit the ignored menubar / toolbar / location / status parameters, and says why
- Adds noopener by default and clears `window.opener`
- Handles the noopener trade-off explicitly: with it in the features string, window.open returns null
- Escapes the URL as a literal, so quotes in it cannot break the string
- Rejects javascript: / data: pseudo-URLs — those do not open a page
- Syntax-highlighted JavaScript or HTML output
How to use
- Enter the URL to open
- Adjust size, position and the switches
- Choose the output: window.open code, or a link tag
- Copy the result — it is ready to use
FAQ
- Why is there no “hide the address bar” option?
- Because modern browsers do not allow it. The `location`, `menubar`, `toolbar` and `status` features are ignored in Chrome and Firefox — the address bar has to stay visible, otherwise a phishing page could pass itself off as a trustworthy chrome-less interface. That is a security decision rather than browser laziness, so the tool does not emit them and does not give you the illusion that it could.
- What does noopener do, and why is it on by default?
- A same-origin page opened with `window.open` can reach back through `window.opener` and navigate the page that opened it — the classic phishing move where a small window opens and the main page turns into a login form. `noopener` severs that reference, and the generated code also nulls `win.opener`, closing both ends. Unless the new window genuinely needs to script its opener, there is no reason to turn it off.
- With noopener on, why is there no `const win = window.open(...)`?
- Because window.open returns null when the features string contains `noopener`. In that case `if (win) win.opener = null` never runs (harmless but pointless) and `window.open(...).focus()` throws on the spot. So in that mode the generated code does not keep a handle at all, and the comment says why — so you can see at a glance that this form cannot control the window.
- Why is nothing popping up?
- Most often the popup blocker: only a `window.open` triggered directly by a user action (a click or key press) is allowed. Calling it inside `setTimeout`, on page load, or after an `await` counts as not user-initiated and gets blocked — the function returns normally and no window appears. Call it directly in the click handler.
Related tools
cURL Toolbox (code / parse / build)
WebTurn a curl command into seven languages of code, or break it into method, headers and body fields; or build a curl command back from an HTTP request.
HTML ↔ JS
WebEscape HTML into a JS string literal — quotes, newlines and a broken `</script>` — or unescape one back into readable HTML. Runs in your browser.
Regex Tester
TextTest a regex in the browser: live highlighting, capture groups, replace preview, a backtracking guard — and JavaScript, Python, Java, Go or PHP code.
URL Parser
WebParse a URL into scheme, host, port, path, query parameters and fragment, with each parameter shown raw and decoded. Runs entirely in your browser.
User-Agent Parser
WebParse a user agent into browser, version, OS, device type and engine, and see which rules matched. Pattern matching only. Runs entirely in your browser.
HTTP Status Codes
WebLook up an HTTP status code for its meaning, 1xx–5xx class, typical uses and common traps. Runs entirely in your browser.