// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
  Widget
} from 'phosphor/lib/ui/widget';


/**
 * The class name added to an IFrame widget.
 */
const IFRAME_CLASS = 'jp-IFrame';


/**
 * A phosphor widget which wraps an IFrame.
 */
export
class IFrame extends Widget {
  /**
   * Create a new IFrame widget.
   */
  constructor() {
    super({ node: Private.createNode() });
    this.addClass(IFRAME_CLASS);
  }

  /**
   * The IFrame's URL.
   */
  get url(): string {
    return this.node.querySelector('iframe').getAttribute('src');
  }
  set url(url: string) {
    this.node.querySelector('iframe').setAttribute('src', url);
  }
}


/**
 * A namespace for private data.
 */
namespace Private {
  /**
   * Create the main content node of an iframe widget.
   */
  export
  function createNode(): HTMLElement {
    let node = document.createElement('div');
    let iframe = document.createElement('iframe');
    iframe.style.height = '100%';
    iframe.style.width = '100%';
    node.appendChild(iframe);
    return node;
  }
}

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
  Widget
} from 'phosphor/lib/ui/widget';


/**
 * The class name added to an IFrame widget.
 */
const IFRAME_CLASS = 'jp-IFrame';


/**
 * A phosphor widget which wraps an IFrame.
 */
export
class IFrame extends Widget {
  /**
   * Create a new iframe widget.
   */
  constructor() {
    super({ node: Private.createNode() });
    this.addClass(IFRAME_CLASS);
  }

  /**
   * Load a URL into the iframe.
   *
   * @param url - The URL to load into the iframe widget.
   */
  loadURL(url: string): void {
    this.node.querySelector('iframe').setAttribute('src', url);
  }
}


/**
 * A namespace for private data.
 */
namespace Private {
  /**
   * Create the main content node of an iframe widget.
   */
  export
  function createNode(): HTMLElement {
    let node = document.createElement('div');
    let iframe = document.createElement('iframe');
    iframe.style.height = '100%';
    iframe.style.width = '100%';
    node.appendChild(iframe);
    return node;
  }
}

--- 
+++ 
@@ -18,7 +18,7 @@
 export
 class IFrame extends Widget {
   /**
-   * Create a new iframe widget.
+   * Create a new IFrame widget.
    */
   constructor() {
     super({ node: Private.createNode() });
@@ -26,11 +26,12 @@
   }
 
   /**
-   * Load a URL into the iframe.
-   *
-   * @param url - The URL to load into the iframe widget.
+   * The IFrame's URL.
    */
-  loadURL(url: string): void {
+  get url(): string {
+    return this.node.querySelector('iframe').getAttribute('src');
+  }
+  set url(url: string) {
     this.node.querySelector('iframe').setAttribute('src', url);
   }
 }
Update IFrame interface to use accessors for url.
