InterceptedURLs Property
Applies To: HTMLRenderer

Description

The InterceptedURLs property is a 2-column matrix that specifies whether the HTMLRenderer will attempt to satisfy a request for a resource from the workspace or, via the CEF, from the internet. If directed to the workspace, the request will trigger an HTTPRequest event if the protocol is http, or a WebSocketUpgrade event if the protocol is ws.

The first column is a wild-carded character scalar or vector containing a pattern to match. The second column is a Boolean indicating whether or not the HTMLRenderer should trigger an event. InterceptedURLs may contain any number of rows.

If the requested url is a relative rather than an absolute url, it is prepended by the string http://dyalog_root/. So, for example, if the HTML property contained :

<link rel="stylesheet" href="style.css">
<script src="app.js"></script>

the HTMLRenderer will request http://dyalog_root/style.css and http://dyalog_root/app.js respectively.

When the value of InterceptedURLs is its default ( (0 2⍴'') it is treated as if it were set to ((1 2⍴'*://dyalog_root/*' 1). So by default, requests for a relative url will fire an event in the workspace while absolute urls will be directed by the CEF to the internet.

Note that if code in the page creates a web socket intended for internal use, with anything other than dyalog_root as the url, the url must match a pattern in InterceptedURLs with 1 in the second column. The following example does not require a matching pattern in InterceptedURLs.

 // Create a new WebSocket.
  window.socket = new WebSocket('ws://dyalog_root/');

Examples:

The following will trigger an event for all requested URLs

      InterceptedURLs ← 1 2⍴'*' 1

The following will attempt to retrieve from the net URLs containing '.dyalog.com' and trigger an HTTPRequest event for all other requested URLS

      InterceptedURLs ← 2 2⍴'*.dyalog.com*' 0 '*' 1