Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using Delphi & the DCEF (Delphi Chromium Embedded Framework) to load a local HTML file into a browser embedded within a form. The HTML file is trying to display a Google Map & has the line -

<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true&v=3.6&client=gme-{mycompanyid}"></script>

but the problem is that the URL sent as the referer to Google APIs is

HTTP://127.0.0.1/mypage.html

We have already authorised our website URLs for our Business Client ID, and we want to use the same Business Client ID for this desktop application.

My question is - how can I get the calls to Google API to use a different referer ? I think its not possible.

share|improve this question
    
Just a guess, but what about to modify the request header in OnBeforeBrowse event ? –  TLama Jul 31 '13 at 11:42
    
Thanks, I did try this. The OnBeforeBrowse event only fires when the page loads, not when the Google map tiles are retrieved. –  daveD Jul 31 '13 at 11:50
    
I thought it is being sent just once when the map is initialized. Well, sorry then; unsuccessful guess... –  TLama Jul 31 '13 at 12:05
    
it seems you are interested in the result. The HTML file is trying to display a Google Map . So why you not pass the correct URL http://ourBusiness.com/myPage.html to your embedded browser ? –  moskito-x Jul 31 '13 at 19:28
    
@moskito-x - the HTML file is held locally, i.e. the embedded browser is loading url file://path/to/my/file/myPage.html, and the problem is then the Google scripts requesting the tiles from their API use this as the referer, I need them to use ourBusiness.com as the referer, because thats the authorised URL for our business use of the API. –  daveD Aug 1 '13 at 8:23

1 Answer 1

Decided not to persue this, a locally hosted HTML file is really a security risk. We are still using the embedded DCEF browser in a Delphi form, but host the HTML file on our corporate webserver. That way the Google API is happy with the referring URL for map requests.

Thank you to all those who replied.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.