OnTranslateUrl
NewsProductsDownloadsSupportForumCredits

TEmbeddedWB 
History 
HtmlEdit 
TIEAddress 
TIEDownload 
TIEDownloadManager 
IEGuid 
TIEParser 
Favorites 
TIESecurityManager 
IE5Tools 
TIETravelLog 
TLinksBar 
Protocols 
TRichEditWB 
TWebUpdater 
ResourceTool 
UI - lessParser 
Delphi Links 

 

 

[Home][Support][TEmbeddedWB][Events][OnTranslateUrl]


OnBeforeNavigate2OnCommandStateChangeOnDocumentCompleteOnDownloadBeginOnDownloadCompleteOnFullScreenOnGetExternalOnGetHostInfoOnGetOptionKeyPathOnMenuBarOnNavigateComplete2OnNavigateErrorOnNewWindow2OnQuitOnProgressChangeOnPropertyChangeOnScriptError EventOnShowContextMenuOnShowDialogOnShowHelpOnShowMessageOnStatusBarOnStatusTextChangeOnTheaterModeEventOnTitleChangeOnToolbar EventOnTranslateAcceleratorOnTranslateUrlOnUpdateUIOnVisible

 

OnTranslateURL

 

This function is called before loading a URL  to allow you an opportunity to modify the URL.

In the following  example the user is only allowed access to local stored files. If a link to an internet-site is clicked, we want a file "DontDoThis.htm" to be shown.

 

uses comobj;

function
TForm1.EmbeddedWB1TranslateUrL(const dwTranslate: Cardinal;
const pchURLIn: PWideChar; var ppchURLOut: PWideChar): HRESULT;
begin
  if
Pos('file:///',pchURLIn) = 0 then
  ppchURLOut := StrToPLOleStr('DontDoThis.htm');
end;

Similar lines of code could also have been placed in OnBeforeNavigate2 but there is an important difference: OnTranslateUrl is not called when you use Navigate or Navigate2 but only when a hyperlink is clicked. So in this example you could still let a speedbutton call EmbeddedWb1.Go('www.somewhere.com') without  redirecting the user to "DontDoThis.htm".

[Home][News][Products][Downloads][Support][Forum][Credits]

Created   by
Per Lindsų Larsen

Copyright (c) 2005 bsalsa productions. All rights reserved.

bsalsa@bsalsa.no-ip.info