
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@skit/doctitle
Advanced tools
An easy way to dynamically change the document title, compatible with SPA in iOS/Safari, and support fixed prefixes and suffixes. 一种动态修改文档标题的简便方式,兼容 iOS/Safari 中的 SPA,支持固定前缀、后缀。
动态设置 document.title;
可配置固定的前缀、后缀;
兼容 iOS/MacOS 系统下的 SPA 应用,解决 SPA 动态设置文档标题无效的问题;
支持 TypeScript。
安装:
npm install @skit/doctitle
导入:
// require 方式
const $$title = require('@skit/doctitle');
// import 方式
import $$title from '@skit/doctitle';
基本用法:
// 设置标题,设置后文档标题为 'This is a Title'。
$$title.setTitle('This is a Title');
// 设置前缀,设置后文档标题为 'PREFIX - This is a Title'。
$$title.setPrefix('PREFIX - ');
// 设置后缀,设置后文档标题为 'PREFIX - This is a Title | SUFFIX'。
$$title.setSuffix(' | SUFFIX');
高级技巧:
// 兼容 iOS/MacOS 的原理是在页面中创建一个隐藏的 iframe,并设置其 src 属性。
// 默认的加载路径是 ‘/favicon.ico’。
// 如果你的网站不支持这个路径,那么可以指定为其他的路径。
$$title.withHackSource('http://example.com/hack.txt');
// 还可以清空前缀和后缀,直接修改文档标题。
$$title.setTitle('This is a Title', { flush: true });
FAQs
An easy way to dynamically change the document title, compatible with SPA in iOS/Safari, and support fixed prefixes and suffixes. 一种动态修改文档标题的简便方式,兼容 iOS/Safari 中的 SPA,支持固定前缀、后缀。
We found that @skit/doctitle demonstrated a not healthy version release cadence and project activity because the last version was released 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.