Disclaimer: I'm ABSOLUTELY new with JS and HTML and CSS and I'm learning it as I go.
Issue:
I have created a Chrome extension and it kinda works. The issue I'm having is that I'm unable to fetch the browser URL in JS (and later do stuff with it). I read a bunch of SO posts around fetching/getting the browser URL in JS by using window.location.href
but in my case, all it does is get the index.html path!
For the sake of simplicity, assume the extension simply prints the URL that's on the page right now. So, imagine you visit YouTube.com/<random_string>
on tab 1. When you click the extension, it's supposed to display a popup window and display the same URL there (in an HTML div tag). I've gotten this whole thing working, just that I'm unable to get the URL on the page I'm on, in the pop up. Instead, it's printing the index.html path itself (extension://.. index.html). Hope that makes sense.
What am I doing wrong?