datlechin/flarum-posted-on
最新稳定版本:v2.0.0-beta.2
Composer 安装命令:
composer require datlechin/flarum-posted-on
包简介
Display the operating system of the who posted the post.
README 文档
README
Show the operating system, browser, and device next to each post. Backed by matomo/device-detector and User-Agent Client Hints.
What it does
Each post records who it was authored from. The post header gets a small chip with an OS icon and a one-line label. Hover for a tooltip that splits OS, browser, and device on three lines.
The detection combines two signals:
- Legacy
User-Agentfor everything that has historically worked: iOS / iPadOS / Android / Linux versions, browser families, mobile device brands. - User-Agent Client Hints (
Sec-CH-UA-*) for the things the legacy UA cannot tell us, namely Windows 10 vs Windows 11 (both reportWindows NT 10.0) and the real macOS version (Apple froze the UA at10.15.7since macOS 11).
When Client Hints are not available (Firefox, Safari, Tor, older browsers), the version is dropped rather than guessed. A user on Windows 11 in Firefox will see "Windows", not "Windows 10".
Installation
composer require datlechin/flarum-posted-on
Enable from Admin → Extensions, then run:
php flarum migrate php flarum cache:clear
Configuration
Admin → Extensions → Posted On.
| Setting | Default | What it does |
|---|---|---|
display_mode |
os_only |
What renders next to the post. os_only shows "Windows 11"; os_browser shows "Windows 11 · Chrome 121". The full breakdown is always in the tooltip. |
skip_guests |
false |
When on, posts authored by guests get no platform metadata. |
Each user can also opt out from their own posts being labelled, under their account settings.
Privacy
The extension stores a coarse fingerprint of the poster's environment: OS family + version, browser family + version, device type + brand + model. This is derived from the request's User-Agent and Client Hints headers; no IP address is recorded by this extension.
You can:
- Toggle
skip_gueststo ignore guest posts entirely. - Let users hide their own metadata via the privacy switch in their settings.
- Drop the
posted_on_metacolumn or null it out to wipe historical metadata.
Updating from earlier versions
Posts authored before this version keep their existing posted_on string and render unchanged. Only posts created after the upgrade pick up the rich metadata.
The first POST a user makes after install may still miss the platform version: the browser needs to see the Accept-CH advertisement once before it starts attaching high-entropy hints. After the first page load the policy is cached and subsequent posts include the version.
Development
composer test:unit cd js && npm install && npm run build
Links
统计信息
- 总下载量: 3.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-09