What is the easiest way to disable javascript in an etaoin (chrome) browser session?
Is there some config option for it, or am I best just navigating to <chrome://settings/content/javascript?search=javascript>
and toggling it off?
The etaoin docs also mention creating a profile, but maintaining that in the repo feels a faff
Ugh ok this is a pain because chrome implements its UI in the shadow-DOM so you can’t query it with css selectors 😞
I’m not sure I have the stomach for this: https://medium.com/rate-engineering/a-guide-to-working-with-shadow-dom-using-selenium-b124992559f
I’d just go with the profiles. It’s a little fiddly to set up at first, but once you have it, it’s basically a config file (or works like one anyway)
(Caveat: I’m speaking from my experience years ago setting up firefox templates for Selenium, but I expect the procedure is pretty close to the same)
@manutter51 yeah I’ve been looking at that way…
It works; but the problem is the profile is about 200 binary files; half of which are mutable (e.g. chrome caches etc). I’d like to commit something minimal into git, but don’t want to have to figure out by hand which of those files I need to .gitignore
and I can’t seem to create a script to create the profile either
I haven’t really worked in that specific area, but I bet there’s other people in Selenium/Webdriver-land who needed to use chrome profiles in their testing, maybe there’s something on StackOverflow or somewhere?
So far I’ve not found anything
Hmm, what about something like this?
1. Create a profile
2. Zip it
3. Check in the zip file
4. Write a script that unzips the file to the correct location
I guess the script would also need to clean out any previous contents in the profile destination dir, but it should be pretty straightforward.