Replies: 4 comments
-
Incognito mode doesn't support extensions. Did you check sb.cdp.reload(ignore_cache=True, script_to_evaluate_on_load=None)? |
Beta Was this translation helpful? Give feedback.
-
Actually looks lke setting localStorage item using cdp on discord login page doesn't have any result. There's no item created:
|
Beta Was this translation helpful? Give feedback.
-
When you're rollin' in CDP mode, localStorage tends to get wiped after a refresh()-that’s usually 'cause the JavaScript context resets or it kicks off a fresh browsing session. If you wanna keep your data around, the move is to reapply set_local_storage_item() after the page loads and the DOM's good to go. Timing here is everything-run it too early and boom, you’re staring at undefined errors, especially in UC mode where context isolation is way more strict. Now, on sites like Discord, it gets even trickier. If that sounds like a hassle, you’ve got a few backup plays-like injecting scripts once the page's fully loaded, restoring session cookies, or ditching the whole setup for something smoother like Puppeteer. |
Beta Was this translation helpful? Give feedback.
-
Actually problem was that discord remove reference to localStorage https://stackoverflow.com/questions/52509440/discord-window-localstorage-is-undefined-how-to-get-access-to-the-localstorage |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I need to set value in localStorage, I'm using CDP mode
But after sb.cdp.refresh() is called token is being cleared (it's same when I manually add item and refresh cdp page)
So I've tried with UC mode:
But it fails with:
When I manually run :
localStorage.setItem("test", "test")
in console it works only when I change JS context from "top" to "DevTools Performance Metrics"
Beta Was this translation helpful? Give feedback.
All reactions