code: function _onFrameNavigated(event, res) {
          // res = {frame}
          var url = res.frame.url,
              baseUrl,
              baseUrlRegExp;
  
          // Only check domain of root frame (with undefined parentId)
          if (res.frame.parentId) {
              return;
          }
  
          // Any local file is OK
          if (url.match(/^file:\/\//i) || !_server) {
              return;
          }
  
          // Need base url to build reg exp
          baseUrl = _server.getBaseUrl();
          if (!baseUrl) {
              return;
          }
  
          // Test that url is within site
          baseUrlRegExp = new RegExp("^" + StringUtils.regexEscape(baseUrl), "i");
          if (!url.match(baseUrlRegExp)) {
              // No longer in site, so terminate live dev, but don't close browser window
              _close(false, "navigated_away");
          }
      }
docs: WebInspector Event: Page.frameNavigated