browser-close-confirmation

browser-close-confirmation is a skill for Claude Code from Josh-E-S/awesome-pexip-skills. It costs 67 tokens per session (1,670 once invoked), scanned A, original, MIT.

A skill for adding the standard browser confirmation prompt before an in-call user closes or reloads a tab. The prompt asks whether the user really wants to leave an active video meeting.

In plain words
What is it for?
Use it when implementing leave confirmation for Pexip video calls, including preference toggles and redirects after disconnecting.
Why use it?
It helps prevent accidental interruptions to an ongoing call and handles browser-specific details of the beforeunload event.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import {config} from '../config';.

Part of the pexip plugin — 17 skills shipped together

Good fit Use it when implementing leave confirmation for Pexip video calls, including preference toggles and redirects after disconnecting.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Josh-E-S/awesome-pexip-skills
agentmods
npx agentmods add skills/josh-e-s/awesome-pexip-skills/browser-close-confirmation

Made for: Claude Code.

Or install pexip, the plugin that ships this one along with the rest of its 17 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for browser-close-confirmation

README.md
[![agentmods](https://agentmods.dev/badge/skills/josh-e-s/awesome-pexip-skills/browser-close-confirmation/github.svg)](https://agentmods.dev/skills/josh-e-s/awesome-pexip-skills/browser-close-confirmation)
Your own site
<a href="https://agentmods.dev/skills/josh-e-s/awesome-pexip-skills/browser-close-confirmation"><img src="https://agentmods.dev/badge/skills/josh-e-s/awesome-pexip-skills/browser-close-confirmation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for browser-close-confirmation

Your own site · 80×15
<a href="https://agentmods.dev/skills/josh-e-s/awesome-pexip-skills/browser-close-confirmation"><img src="https://agentmods.dev/badge/skills/josh-e-s/awesome-pexip-skills/browser-close-confirmation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,670 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00067 $0.01670
Opus 5 $0.00034 $0.00835
Sonnet 5 $0.00013 $0.00334
Haiku 4.5 $0.00007 $0.00167

Measured 11d ago against content hash 27c257ce184b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

browser-close-confirmation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/browser-close-confirmation/SKILL.md · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pexip browser-close confirmation

The browser's beforeunload hook gives you the standard "Reload site? Changes you made may not be saved" prompt. For a video call, that's exactly what you want when the user accidentally closes the tab — interrupting an active call should require confirmation.

But the implementation has nuance: browsers handle beforeunload differently across versions, the user can toggle the preference mid-call, and disconnectDestination redirects can fight with the prompt. This skill captures the right wiring.

The handler — both modern and legacy patterns

const preventBrowserCloseHandler = (event: BeforeUnloadEvent) => {
    // Modern (recommended) — calling preventDefault triggers the prompt
    event.preventDefault();
    // Legacy support for Chrome/Edge < 119
    event.returnValue = true;
};

Both lines are needed. The W3C spec says preventDefault() is enough; older Chrome/Edge required returnValue to be truthy. Including both is the no-regret default.

You can't customize the message — modern browsers ignore any string you set. The prompt is browser-controlled and locale-aware.

The hook

import {useEffect} from 'react';
import {config} from '../config';
import {BrowserCloseConfirmation} from '../types';
import {useBrowserCloseConfirmationConfig} from './useBrowserCloseConfirmationConfig';

export const useBrowserCloseConfirmation = () => {
    const {shouldShowBrowserCloseConfirmation} = useBrowserCloseConfirmationConfig();

    // Initial wiring: register based on the current config
    useEffect(() => {
        if (shouldShowBrowserCloseConfirmation) {
            window.addEventListener('beforeunload', preventBrowserCloseHandler);
        }
        return () => {
            window.removeEventListener('beforeunload', preventBrowserCloseHandler);
        };
    }, [shouldShowBrowserCloseConfirmation]);

    // React to user toggling the preference mid-call
    useEffect(() =>
        config.subscribe('browserCloseConfirmation', browserClosePrevention => {
            if (browserClosePrevention === BrowserCloseConfirmation.Enabled) {
                window.addEventListener('beforeunload', preventBrowserCloseHandler);
            } else {
                window.removeEventListener('beforeunload', preventBrowserCloseHandler);
            }
        }),
    []);
};

Read the full file on GitHub · 151 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 151 lines · 67 tokens per session scan A 27c257ce184b

Subscribe to this mod's changes

browser-close-confirmation is a skill published in the GitHub repository Josh-E-S/awesome-pexip-skills (1 stars, last pushed 3mo ago), licensed MIT. It adds 67 tokens to every session and 1,670 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

playwright-component-testing

Set up component testing with Playwright using a story gallery — scaffold stories and a gallery dev page driven by the built-in mount fixture, no dedicated component-testing runtime. Use when asked to test React or Vue components in isolation with Playwright, or to migrate off @playwright/experimental-ct-react / -vue.

microsoft/playwright · 69 tokens

next-dev-loop

Verify Next.js runtime behavior after editing app code. Use this skill to confirm a change actually works in a running app — not just that it compiles or type-checks. Combines /next/mcp (Next.js's view) with agent-browser (the browser's view). Requires a running next dev.

vercel/next.js · 68 tokens

next-partial-prefetching-optimizer

Optimize what selected Next.js client navigations include before the click under Partial Prefetching. Use after Cache Components and Partial Prefetching are adopted when the user wants selected URL-specific UI to be instant, wants reusable content to wait for navigation, or needs to choose between default, viewport…

vercel/next.js · 82 tokens