title: How to add frames to an existing frameset using userscript?
body: <p>The target page has a simple HTML setup:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;frameset id="mainset" rows="50%,50%"&gt;
      ...
      &lt;/frameset&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and I'd like to add frames using JavaScript.</p>
  
  <hr>
  
  <p>This doesn't work:</p>
  
  <pre><code>var parent = document.getElementsByTagName("frameset")[0];
  var child = document.createElement("frame");
  child.src = "about:blank";
  child.style = "background-color: red;";
  
  parent.appendChild(child);
  </code></pre>
  
  <p>This does work, but it creates an iframe:</p>
  
  <pre><code>var parent = document.getElementsByTagName("body")[0];
  var child = document.createElement("iframe");
  child.src = "about:blank";
  child.style = "background-color: red;";
  
  parent.appendChild(child);
  </code></pre>
  
  <p>Is there a way to add frames to the frameset using javascript?</p>
  
  <p>Sorry if this question has been asked before. I searched and found a lot of 'solutions' for people having similar problems, but those don't seem to apply here.</p>
  
  <p>The target page looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/sjjbv.png" rel="nofollow noreferrer" title="Click for a larger image."><img src="https://i.stack.imgur.com/sjjbvl.png" alt="screenshot" title="Click for a larger image."></a></p>