
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
A lightweight React library that tracks browser history navigation depth by intercepting the History API.
A lightweight React library that tracks browser history navigation depth by intercepting the History API.
pushState and replaceStatenpm install modoru
# or
pnpm add modoru
# or
yarn add modoru
Add the ModoruScript component to your app's root layout.
import { ModoruScript } from 'modoru';
export default function Layout({ children }) {
return (
<html>
<head>
<ModoruScript />
</head>
<body>{children}</body>
</html>
);
}
Use the isModoruRoot() function to determine if the user is at the initial page of your application.
'use client';
import { isModoruRoot } from 'modoru';
import { useRouter } from 'next/navigation';
function MyComponent() {
const router = useRouter();
return (
<div>
<button
onClick={() => {
if (isModoruRoot()) {
router.push('/');
} else {
router.back();
}
}}
>
Go Back
</button>
</div>
);
}
<ModoruScript />A React component that injects a script to intercept the History API. This component should be placed as early as possible in your application tree.
Props:
<script> element props except dangerouslySetInnerHTMLref forwardingisModoruRoot(): booleanReturns true if the user is at the root (initial) navigation state, false otherwise.
Returns: boolean
Modoru works by intercepting the browser's History API methods (pushState and replaceState) and tracking a navigation counter in the history state object using the __MODORU key.
pushState: Increments the navigation counterreplaceState: Preserves the current navigation counterThis approach allows you to track navigation depth without requiring route-level integration or framework-specific code.
FAQs
A lightweight React library that tracks browser history navigation depth by intercepting the History API.
The npm package modoru receives a total of 35 weekly downloads. As such, modoru popularity was classified as not popular.
We found that modoru demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.