This commit is contained in:
kulikov committed 2026-03-23 21:13:15 +01:00
1 parent 61ef2aa2bd
commit e8da07179a
32 files changed
+3633 -161

No files matched your search

+4 -18
View File
@@ -1,19 +1,5 @@
const { webFrame } = require('electron');
const fs = require('fs');
const path = require('path');
const { webFrame, ipcRenderer } = require('electron');
const url = window.location.href;
const hookFile = url.includes('telemost.yandex') ? 'creator-telemost.js' : 'creator-vk.js';
const hookCode = fs.readFileSync(path.join(__dirname, '..', 'hooks', hookFile), 'utf8');
const logCapture = `
window.__hookLogs = window.__hookLogs || [];
var _origLog = console.log;
console.log = function() {
_origLog.apply(console, arguments);
var m = Array.prototype.slice.call(arguments).join(' ');
if (m.indexOf('[HOOK]') !== -1) window.__hookLogs.push(m);
};
`;
webFrame.executeJavaScript(logCapture + hookCode);
ipcRenderer.invoke('get-hook-code', window.location.href).then(function(code) {
webFrame.executeJavaScript(code);
});