title: Javascript window.location.pathname giving out wrong result
body: <p>I am using REST API to create a sidebar &quot;extension&quot; on a already existing site. In my JS code I'm calling window.location.pathname to get a certain path from the site url.
  For Example: <a href="https://miro.com/app/board/o9J_khy7PQ8=/" rel="nofollow noreferrer">https://miro.com/app/board/o9J_khy7PQ8=/</a></p>
  <p>the problem is that when I call <code>window.location.pathname</code> I get back the pathname from the server where my extension is stored like so: <a href="https://hof.claris.sk/miro/layers0.8.7/sidebar.html" rel="nofollow noreferrer">https://hof.claris.sk/miro/layers0.8.7/sidebar.html</a> . So I get back miro/layers0.8.7/sidebar.html.</p>
  <p>Is there any way to get back the actual website url / pathname from the window? I'm sure the window url is not my server since it this shows up:
  <a href="https://i.stack.imgur.com/2lJUR.jpg" rel="nofollow noreferrer">url picture</a></p>
  <p>I'm using this code to get the window location</p>
  <pre><code>let pathArray = window.location.pathname.split('/')
  boardId =  pathArray[2]
  </code></pre>
  <p>Here is how the site layout looks, the sidebar is outlined in blue and the link is the actual website underlined in red
  <a href="https://i.stack.imgur.com/qA84E.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qA84E.jpg" alt="enter image description here" /></a></p>