Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
MdNaushad
New Member

Issue with main script file query selecting the iframe

Hello Everyone, Hope you are doing all well. 



We have a chrome extension in Google Chrome Store, and we are facing a problem specifically with power bi website. 
What we have noticed is, in the main.34f71e48ece3f91f3cbc.js, while looking for iframe in the page, this is the code 

 

this.documentService.nativeDocument.querySelector("iframe").onload = e=>{
    this.$scope.$emit("iFrameLoaded")
}

 
Through our extension , we inject an iframe to the page right after the beginning of the body tag, (we are injecting iframe to gather few metrics, the iframe has javascript code)
and the code above instead of selecting the powe-bi page iframe selects the iframe injected by the extension and attaches the onload event to the extension iframe.

The ideal code for this should have been

this.documentService.nativeDocument.querySelector("#pbi-iframe").onload = e=>{
   this.$scope.$emit("iFrameLoaded")
}

i.e. atleast the selection of iframe should have been through some specified id or through css or through some identifier. 
This way the script is blindly looking for an iframe. 

Can someone please suggest if there is any alternative to work around this? 
Following points were already considered
a) Try to append the extension iframe at the end instead of at the start (but this might cause some values that the extension is calculating to be deviated)

b) Delay the attaching of extension iframe - this has the same impact as first approach

 

 

0 REPLIES 0

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors