It’s a CORS issue.

The browser is loading using the LoadFromFile method – hence the resource is 
seen as local, and the invoked JS is calling a method on a remote server.

Cheers

D

From: [email protected] 
[mailto:[email protected]] On Behalf Of John Bird
Sent: Wednesday, 15 April 2015 10:52 a.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Embedded Web Browser mystery

XE7 – we have a real mystery going on with an Embedded Web Browser (3rd party 
variant of TWebBrowser with more properties and methods exposed).

Have an application where a web page calls a snippet of HTML and calls some 
script files in javascript and a particular response which does an Ajax call.

-Works fine in a proof of concept program
- Works fine in the IE browser
- does not work in the Embedded Web Browser on the main form where we want it 
to work – the javascript throws errors such as “Error: permission denied”  
“undefined”
(all other parts of the javascript are working fine)
- the example proof of concept form linked into the same application as a 
separate form does work properly
- if I delete the original web browser component and copy the working one onto 
the main form it does not work.
- comparing the javascript that both the working and non-working web browser 
components get - they are identical   (using view source)
-Substituting the embedded web browser with the standard TWebBrowser produces 
the same problem (ie its not the embedded web browser that’s the issue)

The two embedded web browsers have as far as possible identical settings -
As far as I can figure, there seems to be something else such as form 
properties or main for versus secondary form that is interfering with the 
behaviour of the embedded web browser.   Our guess is something is triggering 
the web browser to refuse to get the scripts – treating them as cross domain or 
some similar issue even though the same works elsewhere in the same program.

If its useful can post the javascript – its not complex.


********************************************************************************
This email or attachment(s) may contain confidential or legally privileged 
information intended for the sole use of the addressee(s). Any use, 
redistribution, 
disclosure, or reproduction of this message, except as intended, is prohibited. 
If you received this email in error, please notify the sender and erase all 
copies of the message, including any attachments.

Any views or opinions expressed in this email (unless otherwise stated) may not 
represent those of Pegasus Health Ltd.

********************************************************************************
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [email protected] with 
Subject: unsubscribe

Reply via email to