etaoin

2021-04-06T12:18:24.006400Z

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?

2021-04-06T12:19:31.007100Z

The etaoin docs also mention creating a profile, but maintaining that in the repo feels a faff

2021-04-06T13:07:08.008Z

Ugh ok this is a pain because chrome implements its UI in the shadow-DOM so you can’t query it with css selectors 😞

2021-04-06T13:07:38.008400Z

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

2021-04-06T13:15:50.009200Z

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)

2021-04-06T13:16:48.010100Z

(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)

2021-04-06T13:55:57.011800Z

@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

2021-04-06T13:56:42.012400Z

and I can’t seem to create a script to create the profile either

2021-04-06T14:00:08.013700Z

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?

2021-04-06T14:01:42.014100Z

So far I’ve not found anything

2021-04-06T14:13:32.015400Z

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

2021-04-06T14:14:32.016300Z

I guess the script would also need to clean out any previous contents in the profile destination dir, but it should be pretty straightforward.