Comments (9)
At the very least, it seems we should implement the DOM's set cookie functionality.
from secret-agent.
We currently allow reading cookies but not writing/editing them, however it wouldn't be too difficult to add.
What is your use case for editing cookies?
We hadn't imagined a viable scraping use-case for this, but perhaps we're overlooking something. Let us know... we're open to making this a high priority feature.
from secret-agent.
@calebjclark
Some websites have cookies which are added by doing multiple actions and I want to skip those actions and edit the cookie myself to save memory and time
from secret-agent.
@zedd3v
Have you seen the UserProfiles function? https://secretagent.dev/docs/advanced/user-profile
We've imagined use cases where you would accumulate cookies as above, and then save off a profile to a file or database.
const profile = await browser.user.exportProfile();
Then when you're ready to resume, you'd create a new Browser with:
const browserWithProfile = await SecretAgent.createBrowser({ userProfile: profile, });
By setting up cookies, dom storage, etc this way, we believe it is significantly harder to detect. If you don't want to "save" the state of your session, you could look at the format of the profile and just recreate a profile with your cookies.
from secret-agent.
@blakebyrnes
I saw that function but that's not what I'm looking for.
The cookies need to be edited programmatically after the website sets them
from secret-agent.
@zedd3v
Thanks for clarifying. Would you just want to be able to add "set" to the document.cookie api? Or are you "waiting" for the cookies to be set, and want to be able to intercept and change them before they're saved?
from secret-agent.
@blakebyrnes I would just like a set (replace) cookie API.
But the most preferable solution would be to add javascript execution which most of the users (including me) will probably need
from secret-agent.
We've been hesitant to add the ability to execute arbitrary js code because it opens up things that are hard for us to properly capture in Replay (which is our browser session recording and replay app), and it reintroduces the environment context confusion that puppeteer and playwright have.
Most importantly, it also doesn't emulate what a real user would do, which is our current thinking for how make secret agent the most effective.
Do you have any other examples off the top of your head for things you need (or have needed) for executing raw JavaScript code?
from secret-agent.
Do not have an example currently but I'm sure something will pop up sooner or later.
from secret-agent.
Related Issues (20)
- Help us to help you: please consider improving community standards HOT 6
- aws lambda support? HOT 5
- feature-request: provide interface for MITM Proxy HOT 5
- MITM Socket Server is spawned even if `SA_DISABLE_MITM` is used
- example for waiting for a form submit HOT 8
- failed to install `secret-agent` on Mac
- how to set proxy url and get raw html content HOT 6
- Certificate verification failed HOT 1
- EDIT: waitForFileChooser does not work when using userProfile with 2+ sessionStorage domains HOT 6
- feature request: support css string query in waitForElement HOT 4
- TypeError: Cannot read properties of null (reading 'type') HOT 3
- Fingerprint doesn't change HOT 4
- Chrome version updates? HOT 4
- no webgl support in headed mode, Windows VPS. HOT 4
- UnhandledErrorOrRejection
- Problem with cookieStorage and Twitter HOT 1
- SecretAgent is Moving to @ulixee/hero!
- Download path directory HOT 1
- Download path directory change HOT 1
- Clicking on a canvas inside an iframe HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from secret-agent.