first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import { DevToolsPluginClient } from './DevToolsPluginClient';
import * as logger from './logger';
/**
* The DevToolsPluginClient for the browser -> app communication.
*/
export class DevToolsPluginClientImplBrowser extends DevToolsPluginClient {
browserClientId = Date.now().toString();
/**
* Initialize the connection.
* @hidden
*/
async initAsync() {
await super.initAsync();
this.startHandshake();
}
startHandshake() {
this.addHandskakeMessageListener((params) => {
if (params.method === 'terminateBrowserClient' &&
this.browserClientId === params.browserClientId) {
logger.info('Received terminateBrowserClient messages and terminate the current connection');
this.closeAsync();
}
});
this.sendHandshakeMessage({
protocolVersion: this.connectionInfo.protocolVersion,
pluginName: this.connectionInfo.pluginName,
method: 'handshake',
browserClientId: this.browserClientId,
});
}
}
//# sourceMappingURL=DevToolsPluginClientImplBrowser.js.map