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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
IshaAgarwalDua
New Member

Protocol must match : power bi embed error

I am getting belwo error 

Blocked a frame with origin "http://localhost:6790" from accessing a frame with origin "https://embedded.powerbi.com". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.

 

My code: 

Snippet

var iframe = document.createElement("iframe");
                            iframe.style.display = "none";
                            iframe.src = data.Report.EmbedUrl.replace('https:','');
                            iframe.onload = (function () {
                                iframe.style.display = "block";
                                var m = {
                                    action: "loadReport", accessToken: data.AccessToken
                                };
                                message = JSON.stringify(m);
                                iframe.contentWindow.document.postMessage(message, "*");
                                alert("loaded");
                            });
                            document.getElementById("reportframe").appendChild(iframe);
0 REPLIES 0

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.