diff --git a/packages/playwright-core/src/client/network.ts b/packages/playwright-core/src/client/network.ts index f2314f1328..4e9ea285ce 100644 --- a/packages/playwright-core/src/client/network.ts +++ b/packages/playwright-core/src/client/network.ts @@ -346,9 +346,7 @@ export class Route extends ChannelOwner implements api.Ro async fulfill(options: { response?: api.APIResponse, status?: number, headers?: Headers, contentType?: string, body?: string | Buffer, json?: any, path?: string } = {}) { await this._handleRoute(async () => { - await this._wrapApiCall(async () => { - await this._innerFulfill(options); - }, { internal: true }); + await this._innerFulfill(options); }); } diff --git a/packages/playwright-core/src/server/dispatchers/dispatcher.ts b/packages/playwright-core/src/server/dispatchers/dispatcher.ts index b73c07bae1..ca1db256e9 100644 --- a/packages/playwright-core/src/server/dispatchers/dispatcher.ts +++ b/packages/playwright-core/src/server/dispatchers/dispatcher.ts @@ -24,6 +24,7 @@ import { TargetClosedError, isTargetClosedError, serializeError } from '../error import { SdkObject } from '../instrumentation'; import { isProtocolError } from '../protocolError'; import { compressCallLog } from '../callLog'; +import { methodMetainfo } from '../../utils/isomorphic/protocolMetainfo'; import type { CallMetadata } from '../instrumentation'; import type { PlaywrightDispatcher } from './playwrightDispatcher'; @@ -304,6 +305,12 @@ export class DispatcherConnection { return; } + if (methodMetainfo.get(dispatcher._type + '.' + method)?.internal) { + // For non-js ports, it is easier to detect internal calls here rather + // than generate protocol metainfo for each language. + validMetadata.internal = true; + } + const sdkObject = dispatcher._object instanceof SdkObject ? dispatcher._object : undefined; const callMetadata: CallMetadata = { id: `call@${id}`, diff --git a/utils/generate_dotnet_channels.js b/utils/generate_dotnet_channels.js index b6f0b7716e..15a04af5f1 100644 --- a/utils/generate_dotnet_channels.js +++ b/utils/generate_dotnet_channels.js @@ -136,7 +136,7 @@ function properties(properties, indent, onlyOptional, parentName, level) { if (name === 'android' || name === 'electron') continue; if (name.startsWith('$mixin')) { - visitProperties(mixins.get(value).properties, parentName + toTitleCase(name)); + visitProperties(mixins.get(value).properties, parentName); continue; } const inner = inlineType(value, indent, parentName + toTitleCase(name), level + 1);