Documentation Index
Fetch the complete documentation index at: https://bym.lonestill.uk/llms.txt
Use this file to discover all available pages before exploring further.
Если YM поменяет имя глобальной переменной webpack chunk — getAll() вернёт пустой массив. Модули кешируются при первом обращении.
Методы
// По предикату
api.Webpack.getModule(m => m?.createElement && m?.useState)
// По наличию ключей
api.Webpack.getModuleByProps('push', 'replace', 'goBack')
// По displayName React-компонента
api.Webpack.getModuleByDisplayName('PlayerBarDesktop')
// Все модули (их тысячи)
api.Webpack.getAll()
Пример
BYM.register({ id: 'module-finder' }, (api) => ({
start() {
const all = api.Webpack.getAll();
api.Logger.log('Модулей:', all.length);
const trackModule = api.Webpack.getModule(m =>
typeof m?.fetchTrack === 'function'
);
if (trackModule) api.Logger.log('Keys:', Object.keys(trackModule));
},
stop() {},
}));