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

Implemented Adding Cookies Functionality #1543

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

elmoiv
Copy link

@elmoiv elmoiv commented Dec 10, 2024

Added the ability to add custom cookies to EdgeChrome on NT platforms. This can help in scenarios where the user wants to inject cookies from requests session into the current webview.

Example:

window = webview.create_window('Hello world', 'https://example.com')
...
response = requests.post(login_url, data=payload)
...
for cookie in response.cookies:
    window.add_cookie(
        cookie.name,
        cookie.value,
        cookie.path,
        cookie.domain,
    )

@r0x0r
Copy link
Owner

r0x0r commented Dec 10, 2024

What's wrong with window.evaluate_js('document.cookie = 'newCookie=123'')?

@elmoiv
Copy link
Author

elmoiv commented Dec 10, 2024

Sometimes the easiest solution is in front of your eyes. But you always tend to overwork yourself. Thanks for clarifying a better and more safe way to do so.

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