Enable Adblocker Extension In Chrome Using RSelenium Enable Adblocker Extension In Chrome Using RSelenium selenium selenium

Enable Adblocker Extension In Chrome Using RSelenium


It isn't ablock extension specifically since I like adguard better, but I always use this:

Download adguard FROM A BROWSER OTHER THAN CHROME: https://www.crx4chrome.com/go.php?d=4687&i=158&p=31932&s=1&l=https%3A%2F%2Fclients2.googleusercontent.com%2Fcrx%2Fblobs%2FQwAAAHF3InbmK-wFIemaY3I3BCPa0e33dMYlYToYq-WCs1jSyPlSXnr3dNv-HTinVL8eTmtbBlPjwi-hJEL5_ZnPfXkYphLdiwB7LVwS3slKcj15AMZSmuWuPGYPZfS0woRX9brTIZ8faUYQCg%2Fextension_3_0_13_0.crx

Example download filepath: /Users/admin/Downloads/extension_3_0_13_0.crx

R Code:

library(RSelenium) #install_github("ropensci/RSelenium")cprof <- list(chromeOptions =                 list(extensions =                        list(base64enc::base64encode("/Users/admin/Downloads/extension_3_0_13_0.crx"))                ))rD <- rsDriver(port = 4444L,extraCapabilities=cprof, browser ="chrome",chromever = "latest"))#if error port used or need to clear port#rm(rD)#rm(remDr)#gc() #then try again#set timeout preferences with chrome clientremDr <- rD$clientremDr$setTimeout(type = 'page load', milliseconds = 120000)remDr$setTimeout(type = 'implicit', milliseconds = 120000)