probe: Trial E2 — Electron webContents + undocumented VS Code commands
This commit is contained in:
@@ -436,6 +436,67 @@ function activate(context) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// ========== Trial E2: Electron webContents probe ==========
|
||||
setTimeout(() => {
|
||||
console.log('Gravity Bridge: [Trial E2] Probing Electron webContents...');
|
||||
try {
|
||||
// Try to access Electron APIs from extension host
|
||||
const electron = require('electron');
|
||||
console.log(`Gravity Bridge: [Trial E2] electron keys: ${Object.keys(electron).join(', ')}`);
|
||||
// Try remote (deprecated but might work)
|
||||
if (electron.remote) {
|
||||
const wcs = electron.remote.webContents.getAllWebContents();
|
||||
console.log(`Gravity Bridge: [Trial E2] Found ${wcs.length} webContents via remote`);
|
||||
wcs.forEach((wc, i) => {
|
||||
console.log(` [${i}] id=${wc.id} url=${wc.getURL().substring(0, 80)} title=${wc.getTitle().substring(0, 40)}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Gravity Bridge: [Trial E2] electron: ${e.message}`);
|
||||
}
|
||||
try {
|
||||
// Try @electron/remote
|
||||
const remote = require('@electron/remote');
|
||||
const wcs = remote.webContents.getAllWebContents();
|
||||
console.log(`Gravity Bridge: [Trial E2] @electron/remote: ${wcs.length} webContents`);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Gravity Bridge: [Trial E2] @electron/remote: ${e.message}`);
|
||||
}
|
||||
try {
|
||||
// Try process.mainModule to access main process
|
||||
const mainModule = process.mainModule;
|
||||
console.log(`Gravity Bridge: [Trial E2] mainModule: ${mainModule?.filename?.substring(0, 80)}`);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Gravity Bridge: [Trial E2] mainModule: ${e.message}`);
|
||||
}
|
||||
// Try to find webview frames via VS Code internals
|
||||
try {
|
||||
const vscodeInternal = global._VSCODE_NODE_MODULES;
|
||||
if (vscodeInternal) {
|
||||
console.log(`Gravity Bridge: [Trial E2] _VSCODE_NODE_MODULES keys: ${Object.keys(vscodeInternal).join(', ')}`);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Gravity Bridge: [Trial E2] vscode internals: ${e.message}`);
|
||||
}
|
||||
// Try to list all vscode webview panels through undocumented APIs
|
||||
try {
|
||||
const allCmds = ['workbench.action.webview.openDeveloperTools', 'workbench.experimental.chat.dump'];
|
||||
allCmds.forEach(async (cmd) => {
|
||||
try {
|
||||
const result = await vscode.commands.executeCommand(cmd);
|
||||
console.log(`Gravity Bridge: [Trial E2] ${cmd}: ${JSON.stringify(result).substring(0, 300)}`);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Gravity Bridge: [Trial E2] ${cmd}: ${e.message}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) { }
|
||||
}, 8000);
|
||||
// ========== Stream subscription for active cascades ==========
|
||||
function subscribeToStream(cascadeId) {
|
||||
if (!lsPort || !lsCsrf) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user