I've been trying to port my Chrome extension over to Firefox. Most of the code worked fine, except for this one thing. The extension popup has tab buttons at the top which are supposed to switch between different html files (inside the popup) when clicked. However, when the buttons are clicked, the extension simply freezes/crashes.
Here’s an example of the code for the "contact" tab button:
contactTab = document.getElementById("contact-tab")
contactTab.addEventListener("click", function() {
location = "contact.html"
})
In the Chrome version of my extension I used location.href and it worked perfectly fine, this problem is only on Firefox. I’ve tried using location.href, location and window.location, but nothing has worked.
How do I switch between html files in a Firefox extension popup?