/**
 * 動態透過 IFrame 載入同源(Same Origin)網頁中的特定元素的文字內容。
 *
 * @param iframeSrcURL 傳入要被載入內容的網址。會使用 iframe 載入該網址的內容。並在完成後，該 iframe 會被移除與釋放。
 * @param elementIdInsideIFrame 傳入元素編號。在使用 iframe 載入指定的網頁後，會取得該網頁中該編號元素的文字內容。
 *
 * @return 傳回 Promise，該 Promise resolve 時，會傳入指定網址中指定編號元素的文字內容。
 */
function createPromise_GetTextContent_ByIFrame(iframeSrcURL, elementIdInsideIFrame) {
  return new Promise(function(resolve, reject) {
    var theIFrame = document.createElement("iframe");
    theIFrame.style.display = "none";
    theIFrame.src           = iframeSrcURL;
    theIFrame.sandbox       ="allow-same-origin";
    theIFrame.onload        = function() { resolve(theIFrame); }
    document.body.appendChild(theIFrame);         // Load the URL by iframe.

  }).then(function(theIFrame) {
    var theTextContent = theIFrame.contentDocument.getElementById(elementIdInsideIFrame).textContent;
    theIFrame.parentNode.removeChild(theIFrame);  // Release the iframe.
    return theTextContent;
  });
}

/**
 * Load .textContent by iframe from specified HTML elemen of specified (same origin)
 * web page.
 *
 * @param {string} iframeSrcURL
 *   The web page to be loaded. An iframe will be used to load it. After .textContent
 * has been extracted, the iframe will be released.
 *
 * @param {string} elementIdInsideIFrame
 *   The HTML element id. When the web page has been loaded, the .textContent of the
 * the HTML element with this id will be extracted.
 *
 * @return {Promise}
 *   Return a Promise. When the Promise resolve, the .textContent of the HTML element
 * will be returned.
 */
function createPromise_GetTextContent_ByIFrame(iframeSrcURL, elementIdInsideIFrame) {
  return new Promise(function(resolve, reject) {
    var theIFrame = document.createElement("iframe");
    theIFrame.style.display = "none";
    theIFrame.src           = iframeSrcURL;
    theIFrame.sandbox       ="allow-same-origin";
    theIFrame.onload        = function() { resolve(theIFrame); }
    document.body.appendChild(theIFrame);         // Load the URL by iframe.

  }).then(function(theIFrame) {
    var theTextContent = theIFrame.contentDocument.getElementById(elementIdInsideIFrame).textContent;
    theIFrame.parentNode.removeChild(theIFrame);  // Release the iframe.
    return theTextContent;
  });
}

Improve comments.