Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: expose internal api for extending injected script #3787

Merged
merged 1 commit into from
Sep 7, 2020

Conversation

pavelfeldman
Copy link
Member

No description provided.

@pavelfeldman pavelfeldman force-pushed the extendApi branch 2 times, most recently from 2225f12 to 728db37 Compare September 7, 2020 19:34
return;
(mainContext as any)[debugScriptSymbol] = true;
await mainContext.extendInjectedScript(debugScriptSource.source);
await frame.extendInjectedScript(debugScriptSource.source);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is called on every navigation, including same-document. That means we can extend the same injected script twice. Is that ok?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clients would need to take care of it for now...

@@ -410,6 +410,11 @@ export class Frame extends ChannelOwner<channels.FrameChannel, channels.FrameIni
return (await this._channel.title()).value;
});
}

async _extendInjectedScript<Arg>(source: string, arg?: Arg): Promise<JSHandle> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you plan to call this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants