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

Remove deprecated page.target from documentation #35

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ To modify intercepted requests:
import { RequestInterceptionManager } from 'puppeteer-intercept-and-modify-requests'

// assuming 'page' is your Puppeteer page object
const client = await page.target().createCDPSession()
const client = await page.createCDPSession()
// note: if you want to intercept requests on ALL tabs, instead use:
// const client = await browser.target().createCDPSession()

Expand Down Expand Up @@ -118,7 +118,7 @@ async function main() {
const browser = await puppeteer.launch()
const page = await browser.newPage()

const client = await page.target().createCDPSession()
const client = await page.createCDPSession()
const requestInterceptionManager = new RequestInterceptionManager(client)

const interceptionConfig: Interception = {
Expand Down Expand Up @@ -185,7 +185,7 @@ async function main() {
const browser = await puppeteer.launch()
const page = await browser.newPage()

const client = await page.target().createCDPSession()
const client = await page.createCDPSession()
const requestInterceptionManager = new RequestInterceptionManager(client)

const interceptionConfig: Interception = {
Expand Down Expand Up @@ -223,7 +223,7 @@ async function main() {
const browser = await puppeteer.launch()
const page = await browser.newPage()

const client = await page.target().createCDPSession()
const client = await page.createCDPSession()
const requestInterceptionManager = new RequestInterceptionManager(client, {
onError: (error) => {
console.error('Request interception error:', error)
Expand Down Expand Up @@ -265,7 +265,7 @@ async function main() {
const browser = await puppeteer.launch()
const page = await browser.newPage()

const client = await page.target().createCDPSession()
const client = await page.createCDPSession()
const requestInterceptionManager = new RequestInterceptionManager(client)

const interceptionConfig: Interception = {
Expand Down Expand Up @@ -315,7 +315,7 @@ async function main() {
const browser = await puppeteer.launch()
const page = await browser.newPage()

const client = await page.target().createCDPSession()
const client = await page.createCDPSession()
const requestInterceptionManager = new RequestInterceptionManager(client)

const interceptionConfig: Interception = {
Expand Down