Public embed in SharePoint Iframe loses #theme=night

Bit of an odd/obscure one.

We’re using SharePoint’s ‘embed’ widget (just an IFRAME) to display public questions and dashboards in a SharePoint page.

Slight additional complication is that we’re using MS App Proxy to authenticate the users before they can view the embed.

Customer wants everything in night mode.

The dashboard always works.

The question sometimes displays in light mode. Looking at the page source, we can see that everything in the url after and including the ‘#’ is missing. Hard refresh of the page sometimes fixes it.

I thought it was just an MS Edge issue but I now see it in both Firefox and Chrome.

I’ve not been able to replicate this on my test SharePoint site. I don’t know if it’s something on the customer’s sharepoint.

I assume it’s SharePoint being stupid but has anyone come across anything similar or have thoughts on a potential workaround? I don’t think it’s possible to set the embed mode globally.

Best I can think of is to make sure SharePoint isn’t double-percent-encoding the URL. I think it’s come up here before that editing a URL in sharepoint can make it url-encode it a second time.

It has done but reverts after editing.

What I can’t understand is why it isn’t consistent and doesn’t happen on my test site.

I’ve asked the customer to create a new blank page that I can edit and test on. Fingers crossed.