2025-11-27 13:47:59 -08:00
|
|
|
/*
|
|
|
|
|
* Vencord, a Discord client mod
|
|
|
|
|
* Copyright (c) 2025 Vendicated and contributors
|
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { EquicordDevs } from "@utils/constants";
|
|
|
|
|
import definePlugin from "@utils/types";
|
|
|
|
|
|
|
|
|
|
export default definePlugin({
|
|
|
|
|
name: "HeaderBarAPI",
|
2025-12-10 14:35:29 +01:00
|
|
|
description: "API to add buttons to the header bar and channel toolbar.",
|
2025-11-27 13:47:59 -08:00
|
|
|
authors: [EquicordDevs.Prism],
|
|
|
|
|
|
|
|
|
|
patches: [
|
|
|
|
|
{
|
|
|
|
|
find: '?"BACK_FORWARD_NAVIGATION":',
|
|
|
|
|
replacement: {
|
|
|
|
|
match: /(?<=\i\.Fragment,\{children:\[.{1,500}className:\i\}\))(?=\])/,
|
|
|
|
|
replace: ",...Vencord.Api.HeaderBar._addButtons()"
|
|
|
|
|
}
|
2025-12-10 14:35:29 +01:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
find: "Missing channel in Channel.renderHeaderToolbar",
|
|
|
|
|
replacement: {
|
|
|
|
|
match: /(?<=renderHeaderToolbar",\(\)=>\{.{1,200}let (\i)=\[\];)/,
|
|
|
|
|
replace: "Vencord.Api.HeaderBar._addChannelToolbarButtons($1);"
|
|
|
|
|
}
|
2025-11-27 13:47:59 -08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
});
|