Access PrivacyBadger results from Selenium tests #2833
-
Hi all, Basically, I'm trying to check "privacy compliance" of various websites (Public Administrations, mainly), and I want to automate such a check with Selenium. Instead of reinventing the wheel adding my own logic to search for relevant tag, script, cookie, etc.... I thought to use Selenium with a Firefox profile that includes the Privacy Badger Extension, so to offload the detection activities to PB... I've been successful in configuring the profile and, at the moment, when selenium request a web-page, it properly show PB results (see image below). How can I get further, retrieving such info from within my code? Can PB "inject" its result somewhere so, for me, to retrieve it? As far as you know, is there a way, from Selenium, to get access to "extension data" ( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello! You could open Per-tab results are stored in the Note that you will need to open Let me know if this helps. |
Beta Was this translation helpful? Give feedback.
Hello! You could open
options.html
, get a handle to the background page and thus gain access to the various data structures.Per-tab results are stored in the
badger.tabData
object. You can find an example of querying tab data in Privacy Badger's Selenium-powered tests.Note that you will need to open
options.html
in a new window, keeping the original website tab open to avoid Privacy Badger cleaning uptabData
.Let me know if this helps.