<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Issue with main script file query selecting the iframe in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Issue-with-main-script-file-query-selecting-the-iframe/m-p/3506922#M31581</link>
    <description>&lt;P&gt;Hello Everyone, Hope you are doing all well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;We have a chrome extension in Google Chrome Store, and we are facing a problem specifically with power bi website.&amp;nbsp;&lt;BR /&gt;What we have noticed is, in the&amp;nbsp;main.34f71e48ece3f91f3cbc.js, while looking for iframe in the page, this is the code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.documentService.nativeDocument.querySelector("iframe").onload = e=&amp;gt;{
    this.$scope.$emit("iFrameLoaded")
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;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)&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;The ideal code for this should have been&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.documentService.nativeDocument.querySelector("#pbi-iframe").onload = e=&amp;gt;{
   this.$scope.$emit("iFrameLoaded")
}&lt;/LI-CODE&gt;&lt;P&gt;i.e. atleast the selection of iframe should have been through some specified id or through css or through some identifier.&amp;nbsp;&lt;BR /&gt;This way the script is blindly looking for an iframe.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can someone please suggest if there is any alternative to work around this?&amp;nbsp;&lt;BR /&gt;Following points were already considered&lt;BR /&gt;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)&lt;/P&gt;&lt;P&gt;b) Delay the attaching of extension iframe - this has the same impact as first approach&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Oct 2023 10:43:41 GMT</pubDate>
    <dc:creator>MdNaushad</dc:creator>
    <dc:date>2023-10-31T10:43:41Z</dc:date>
    <item>
      <title>Issue with main script file query selecting the iframe</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Issue-with-main-script-file-query-selecting-the-iframe/m-p/3506922#M31581</link>
      <description>&lt;P&gt;Hello Everyone, Hope you are doing all well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;We have a chrome extension in Google Chrome Store, and we are facing a problem specifically with power bi website.&amp;nbsp;&lt;BR /&gt;What we have noticed is, in the&amp;nbsp;main.34f71e48ece3f91f3cbc.js, while looking for iframe in the page, this is the code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.documentService.nativeDocument.querySelector("iframe").onload = e=&amp;gt;{
    this.$scope.$emit("iFrameLoaded")
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;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)&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;The ideal code for this should have been&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.documentService.nativeDocument.querySelector("#pbi-iframe").onload = e=&amp;gt;{
   this.$scope.$emit("iFrameLoaded")
}&lt;/LI-CODE&gt;&lt;P&gt;i.e. atleast the selection of iframe should have been through some specified id or through css or through some identifier.&amp;nbsp;&lt;BR /&gt;This way the script is blindly looking for an iframe.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can someone please suggest if there is any alternative to work around this?&amp;nbsp;&lt;BR /&gt;Following points were already considered&lt;BR /&gt;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)&lt;/P&gt;&lt;P&gt;b) Delay the attaching of extension iframe - this has the same impact as first approach&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 10:43:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Issue-with-main-script-file-query-selecting-the-iframe/m-p/3506922#M31581</guid>
      <dc:creator>MdNaushad</dc:creator>
      <dc:date>2023-10-31T10:43:41Z</dc:date>
    </item>
  </channel>
</rss>

