'python selenium get_log("performance") won't log webworker requests

following many article one can log XHR calls in an automated browser (using selenium) as bellow:

capabilities = DesiredCapabilities.CHROME
capabilities["loggingPrefs"] = {"performance": "ALL"}  # newer: goog:loggingPrefs driver = webdriver.Chrome(
desired_capabilities=capabilities, executable_path="./chromedriver" )
...
logs_raw = driver.get_log("performance")

my probleme is the target request is performed by a "WebWorker", so it's not listed in the performance list of the browser main thread.

getting in chrome and manualy selecting the webworkers scope in the dev console "performance.getEntries()" gets me the request i want;

my question is how can someone perform such an action in selenium ? (python preferable). no where in the doc of python selenium or Devtool Api have i found something similar

i'm so greatful in advance.

Edit: after some deggin i found that it has something to do with execution context of javascrip, i have no clue how to switch that in selenium



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source