diff --git a/src/rpc/channels.ts b/src/rpc/channels.ts index b9333abe58..9ee5fd81e9 100644 --- a/src/rpc/channels.ts +++ b/src/rpc/channels.ts @@ -118,9 +118,7 @@ export interface SelectorsChannel extends Channel { export type SelectorsRegisterParams = { name: string, source: string, - options: { - contentScript?: boolean, - }, + contentScript?: boolean, }; export type SelectorsRegisterResult = void; export type SelectorsCreateSelectorParams = { diff --git a/src/rpc/client/selectors.ts b/src/rpc/client/selectors.ts index 87ede311e2..1fac829cbf 100644 --- a/src/rpc/client/selectors.ts +++ b/src/rpc/client/selectors.ts @@ -30,7 +30,7 @@ export class Selectors extends ChannelOwner { const source = await helper.evaluationScript(script, undefined, false); - await this._channel.register({ name, source, options }); + await this._channel.register({ ...options, name, source }); } async _createSelector(name: string, handle: ElementHandle): Promise { diff --git a/src/rpc/protocol.pdl b/src/rpc/protocol.pdl index be45a1b545..bc559cbf52 100644 --- a/src/rpc/protocol.pdl +++ b/src/rpc/protocol.pdl @@ -108,8 +108,7 @@ interface Selectors parameters name: string source: string - options: object - contentScript?: boolean + contentScript?: boolean command createSelector parameters diff --git a/src/rpc/server/selectorsDispatcher.ts b/src/rpc/server/selectorsDispatcher.ts index 1cae7b1803..987cdedf98 100644 --- a/src/rpc/server/selectorsDispatcher.ts +++ b/src/rpc/server/selectorsDispatcher.ts @@ -25,8 +25,8 @@ export class SelectorsDispatcher extends Dispatcher { - await this._object.register(params.name, params.source, params.options); + async register(params: { name: string, source: string, contentScript?: boolean }): Promise { + await this._object.register(params.name, params.source, params); } async createSelector(params: { name: string, handle: ElementHandleDispatcher }): Promise<{ value?: string }> {