ok habs jetzt doch selber herausgefunden
Delphi-Quellcode:
procedure AppendToWBA(document: IHTMLDocument2);
var
novoScript : IHTMLDOMNode;
begin
if Assigned(document)
then
begin
novoScript := document.createElement('
script')
as IHTMLDOMNode;
(novoScript
as IHTMLScriptElement).text := '
function setTimeout(){};function window.focus(){};function focus(){};function window.alert(){};function alert(){}; function window.confirm(){};function confirm(){}; function window.prompt(){};function prompt(){};function window.open(){};';
(document.body
as IHTMLDOMNode).appendChild(novoScript);
end;
end;
procedure TForm1.WBLoad(ASender: TObject;
const pDisp: IDispatch;
var URL: OleVariant);
var
currentBrowser: IWebBrowser2;
document: IHTMLDocument2;
begin
currentBrowser := pDisp
as IWebBrowser2;
document := currentBrowser.Document
as IHTMLDocument2;
AppendToWBA(document);
end;
manchmal ich weniger halt doch mehr