Using Google Maps from a local webpage with Delphi & DCEF - delphi

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.

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.

Related

Access to a PDF File in a http with dinamyc variables

Hello everyone (sorry for bad English), i'm getting crazy with this problem... i'm working on a project with NiFi expecting to download PDF files from a public Goverment page. The main problem it's that the page you request in a web browser shows the correct page like this
Asking the same page in NiFi (also testing in postman) shows that the session has expire, then looking at the HTTPS POST with the development tools in chrome i notice that there are multiple headers that contain dynamic variables
Is there any form to replicate web browser behaviour on NiFi?

Delphi client that runs like it is connected to a web server - without a web server. Is it possible?

I am familiar with programming in Delphi stand-alone applications and web-server applications.
Is it possible to have a Delphi application that when launched gets the browser to handle its output? Without a server being between the user and the application.
The reason I would like to do this is because HTML CSS and so on provide a more familiar user-interface to most people.
You can not "let the browser handle its output" without any HTTP connection, so a local web server, then using regular URIs like http://localhost:888/myDelphiApp/FullURI.
What you can is to embed a Web Browser to your Delphi application, then provide the generated web content not via HTTP, but as local content.
You may use
THtmlViewer Open Source component - which I like very much;
Delphi Chromium Embedded;
WebBrowser Component.
All recognize CSS and HTML content.

Zendesk app integration

I created a web application by using HTML, JS, JQuery, and some Jquery plugins. Now I want to integrate it into Zendesk. Can I use it like just copy all my files and paste it into zendesk zip file ? Or Do I have to re-code entire thing to make it work for ZenDesk ?
I checked the examples in online, they didn't mentioned anywhere about reusing the apps that already developed in Zendesk.
I am currently doing some fairly extensive Zendesk integration. If you are referring to customisation on the Agent Portal side then it will have to be a Zendesk App under strict Zendesk adopted frameworks jquery is included (http://developer.zendesk.com/documentation/apps/). If in the customer facing Help Center you can simply go into there on screen editor and paste your html, js, etc into the relevant sections see (https://support.zendesk.com/entries/22618341)
Good luck,
Tris
If you want to integrate your app to Zendesk as an Agent App, you might consider the chance of using within an iframe.
Note that the url to which the iframe is pointing to must be served as HTTPS. Otherwise, it won't work.
EDIT:
As of version 2.0 of ZAF (Zendesk Application Framework), it's easy to integrate any webpage. In v2.0, you aren't restricted to any technology or environment.

Mathjax not working in browser when hosted on Google Drive

This is first time I'm driving to use Mathjax, the maths is written in LaTeX, it works fine when I open the page locally, but when I host the same page on Google Drive, Mathjax no longer works, I only see the LaTeX code.
Here is the link to the webpage.
https://googledrive.com/host/0B6DfW2X25tuNck9yLTFSX2hiTEE/Group%20challenge%20Topic%206.html
And here is my code.
https://drive.google.com/folderview?id=0B6DfW2X25tuNck9yLTFSX2hiTEE&usp=sharing
I have tried everything, I'm using latest Chrome, so it shouldn't have any issues loading Mathjax
Since Google Drive is using a https:// URL, you need to load all your resources via https as well or you will get a security violation (check the browsers console for these). So that means you need to use an https: URL for MathJax. The MathJax CDN provides an alternate URL for that: https://c328740.ssl.cf1.rackcdn.com/. See the MathJax FAQ for details.

Can Chrome open files (PDF etc) directly in browser for an intranet application?

My ASP.Net MVC app is an intranet app, and in the HTML, I put an anchor link to PDF files that are stored on our network. Chrome does not open these files in the browser if you click on the link, however if you copy the link off the webpage and make a new tab, paste the link in, it will open.
Now, both the app and the files are on the same domain so how can I get PDF to open automatically in a new tab? I have looked at the various Chrome extensions, but they don't seem to work. There must be a way to get local/network based files to open in your intranet using Chrome, please don't say I have to resort to awful Internet Explorer!
Any help much appreciated.
Have you tried to use HTML iframe tag to display the PDF?
Example:
<iframe id="frameID" style="border:1px solid #666CCC" title="PDF in an i-Frame" src="PDFData.pdf" frameborder="1" scrolling="auto" height="1100" width="850" ></iframe>
Out of date for you, but I recently solved this problem on an apache2 server on ubuntu. I believe it's a matter of security from the client browser- so that a webpage can't open client files maliciously
What solution was
mount the network share drive on my web server
html point to pdf inside the mounted drive
(Optional on Apache) use a .htaccess rule to prevent folder indexing (listing all files/folder)
therefore the webpage was opening its own file, not the clients; so firefox/chrome/et al will allow this to happen
The fix should be in your mvc project . Just make sure the action returns FileStreamResult . example:
return new FileStreamResult(new FileStream(filePath, FileMode.Open), MimeMapping.GetMimeMapping(filePath));

Resources