title: How to detect if a page is loaded into a named window?
body: <p>Ok, I posted this question a month ago. Now I think I can rephrase it a bit, and maybe someone can understand my issue somewhat better now.</p>
  <p>We´re using named windows to reuse tabs when the user is opening several links of the same type.
  Links to different products all open in a window named Products <code>&lt;a href='somepage' target='Product'&gt;Product B&lt;/a&gt;</code>. Other collections leading to windows named Org.Info, News and so on.</p>
  <p>The window name is displayed in the top bar for any &quot;Named&quot; window using this code in our shared layout-page.</p>
  <pre><code>&lt;span id=&quot;windowname&quot;&gt;&lt;/span&gt;
      
  &lt;script&gt;
          if (window.name.length &gt; 0) {
              $('#windowname').text('Window: ' + window.name);
          }
  &lt;/script&gt;
  </code></pre>
  <p>All is working well, the window name is showing if it isn't empty, and the tab is reused as expected.</p>
  <p>But if the user continue to browse in this named window I want the window.name to be cleared again, when the next page is loaded.</p>
  <p>I tried with this script to clear it on window.unload, and it clear the window.name, but then the window reusing isn´t working anymore.</p>
  <pre><code>window.onunload = function () {
      window.name = '';
  }
  </code></pre>
  <p>Is there a way to clear the name, only if the call doesn´t have a target window specified?</p>
  <p>Something like this?</p>
  <pre><code>window.onunload = function () {
  if(the call to open a new page in this window has a target.value !=window.name){
      window.name = target.value'';
  }
  }
  </code></pre>