Fork me on GitHub
#etaoin
<
2021-04-06
>
rickmoynihan12:04:24

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 and toggling it off?

rickmoynihan12:04:31

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

rickmoynihan13:04:08

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

manutter5113:04:50

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)

manutter5113:04:48

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

rickmoynihan13:04:57

@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

rickmoynihan13:04:42

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

manutter5114:04:08

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?

rickmoynihan14:04:42

So far I’ve not found anything

manutter5114:04:32

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

manutter5114:04:32

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