Extract information out of a shadowroot that is in a iframe with a Chromeextansion in Javascript

My problem is that I need to extract IDs from an iframe on a website that is not mine using my Chrome extension, which maps tenant IDs. I am able to extract the IDs in the iframe console on the website, but I don’t know how to specify my code so it only runs in the iframe console and not in the top console. I would be very grateful for any assistance.
If you have further questions hit me up .

I was expecting to get the ids that i was able to extract in the console but i was blocked by the shadowroot and also (Blocked a frame with origin “…”from accessing a cross-origin frame ).