public void ModifyPage() {
Execute(@"window.__cm_loaded = true;
window.onerror = function(error, url, line, column){ window.external.OnError(error, url, line, column); };
document.addEventListener('mousedown', function(e){
var t = e.target;
if (t.tagName != 'A' || !t.href) return;
if (t.href.indexOf(location.host) !== -1){
if (t.getAttribute('target') == '_blank') t.setAttribute('target', '_parent');
} else if (t.getAttribute('__cm_added') != 'y'){
t.setAttribute('__cm_added', 'y');
t.addEventListener('click', function(ev){
if (ev.which == 1){
window.external.NavigateTo(this.href);
ev.preventDefault();
ev.stopPropagation();
}
});
}
}, false);");
}