Forum Discussion
Power BI custom visual not sending Referer
- 5 months ago
Thank you for the prompt response! It's unfortunate to hear that there is no way of making custom visuals support referrer requests. We will have to try one of the work-arounds. Thank you again!
For other users coming here. Specifically for Custom Power BI Visuals, Referrer Headers, and possibly getting blocked by OpenStreetMap with the 403r referrer is required:
Yes, even if you set the reffer-policy for your tile HTTP or HTTPS requests, or if Leaflet.js sets this, the specific Referrer HTTP header never gets sent for Custom Power BI Visuals.
This is shown here https://community.openstreetmap.org/t/access-blocked-on-osm-org/141419/43
I looked through the Sandbox code for Custom Visuals in Power BI
It has this injectJsCode function that creates an isolated clone of the window object.
// ...
I don't know exactly how, but this seems to make the Referrer header not send, even if you set the Referrer Policy to a value that would send a Referrer header. I feel like the JavaScript loses what host/domain/origin it's running when the Window object is cloned (created) like this.