acbarbosa1964 / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
Other
0 stars 2 forks source link

Warning: Can't locate... when clicking on a web link #353

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Which steps will reproduce the problem?
 1. Load an HTML viewer with the following text:
    <a href="http://en.wikipedia.org/wiki/Floating_point">
    http://en.wikipedia.org/wiki/Floating_point</a><br>
    <a href="http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html">
    http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html</a>
 2. Start the program and click the first link. As no method has been defined
    for the link clicking, nothing happens. That's fine.
 3. Click the second link. By some reason, the message 'Can't locate' (plus
    the http link text preceded by the current folder) appears.

What is the expected output?
 4. I would expect the same as with the first link - that NOTHING happens.

Which version of the product are you using?
  HTMLView 11.4

Which compiler version are you using?
  Delphi XE2

On which operating system?
  Windows 7, 64bit

Original issue reported on code.google.com by weidner....@t-online.de on 18 May 2014 at 7:28

Attachments:

GoogleCodeExporter commented 9 years ago
Andreas, 

the THtmlViewer component handles file names only and does not know anything 
about protocols like http:. That's why the built-in default click handler 
expands the second file name with the base path of the loaded document and - of 
course - fails to load it. 

The first link is ignored as it has no "file" extension and won't be opened 
even if it were a HTML document. THtmlViewer only tries to load [X]HTML 
documents, text files and images. The types are identified by file extension. 
In procedure HtmlViewer.InitFileTypes you can find a list of recognized file 
extensions.

I'd prefer not to take action on this behaviour before version 11.5 is 
released. After that it is planned to unify the document loading methods of 
THtmlViewer, TFrameViewer and TFrameBrowser and add pluggable protocol 
handlers. The the message would be something like 'Cannot load "<url>". No 
handler for protocol "<protocol>" found in "<list of supported protocols>"'.

A more sophisticated document type detection would be nice, too.

OrphanCat

Original comment by OrphanCat on 26 May 2014 at 6:54