---
id: "P:cAlgo.API.WebViewWebMessageReceivedEventArgs.Source"
kind: "property"
type: "T:cAlgo.API.WebViewWebMessageReceivedEventArgs"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/WebViewWebMessageReceivedEventArgs/Source/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# WebViewWebMessageReceivedEventArgs.Source

Member of [WebViewWebMessageReceivedEventArgs](https://help.ctrader.com/ctrader-algo/references/EventArgs/WebViewWebMessageReceivedEventArgs/index.md).

## Source

Gets the URI of the document that sent this web message.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Never raised in the CLI: the events that pass it never fire there (WebView.WebMessageReceived).
- Cloud: Never raised in the cloud: the events that pass it never fire there (WebView.WebMessageReceived).

C#:

```csharp
public string Source {get;}
```

Python:

```python
webViewWebMessageReceivedEventArgs.Source: str
```

### Returns

`string` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    var webView = new WebView();
    webView.WebMessageReceived += OnWebMessageReceived;
    Chart.AddControl(webView);
    webView.NavigateAsync("https://ctrader.com/");
}

private void OnWebMessageReceived(WebViewWebMessageReceivedEventArgs args)
{
    if (!args.Source.StartsWith("https://ctrader.com"))
        Print("Ignoring message from untrusted source {0}", args.Source);
}
```

Python:

```python
def on_start(self):
    webView = WebView()
    webView.WebMessageReceived += self.on_web_message_received
    api.Chart.AddControl(webView)
    webView.NavigateAsync("https://ctrader.com/")

def on_web_message_received(self, args):
    if not args.Source.startswith("https://ctrader.com"):
        api.Print(f"Ignoring message from untrusted source {args.Source}")
```

