-
Notifications
You must be signed in to change notification settings - Fork 42
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
Cookies: Retrieving and filtering by URLs #6
Labels
cookies
feature
A new feature
playwright
Issue relating to Playwright compatibility
user request
Requested by the community
Comments
robingustafsson
added
feature
A new feature
playwright
Issue relating to Playwright compatibility
labels
Sep 30, 2021
robingustafsson
changed the title
Implement BrowserContext.cookies([urls])
Implement Nov 12, 2021
BrowserContext.cookies([urls])
It might be neat if these cookies could be easily transferred to the protocol-level |
A possible workaround until this API is implemented if the cookie you're trying to access is not a import launcher from 'k6/x/browser';
export default function() {
const browser = launcher.launch('chromium', {
headless: __ENV.XK6_HEADLESS ? true : false,
slowMo: '500ms' // slow down by 500ms
});
const context = browser.newContext();
const page = context.newPage();
page.goto('https://google.com/', { waitUntil: 'networkidle' });
const cookies = page.evaluate(_ => {
return Object.fromEntries(document.cookie.split('; ').map(x => x.split(/=(.*)$/,2).map(decodeURIComponent)));
});
console.log(JSON.stringify(cookies));
page.close();
browser.close();
} |
inancgumus
changed the title
Implement
Retrieve cookies by URLs
Aug 31, 2023
BrowserContext.cookies([urls])
inancgumus
changed the title
Retrieve cookies by URLs
Retrieve cookies filtered by URLs
Aug 31, 2023
This was referenced Sep 7, 2023
Merged
inancgumus
changed the title
Retrieve cookies filtered by URLs
Cookies: Retrieving and filtering by URLs
Sep 19, 2023
This was referenced Sep 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cookies
feature
A new feature
playwright
Issue relating to Playwright compatibility
user request
Requested by the community
Add support for
BrowserContext.cookies([urls])
, to return all cookies or only cookies for specified URLs in browser context.Relevant links:
Tasks
The text was updated successfully, but these errors were encountered: