1

Is there a way to open a link in a WebExtension sidebar to the currently active tab? I don't want to automatically open the link in a new tab. I'm talking about regular links:

<a href="https://www.example.com">Example</a>

Things I've tried:

  • Adding any target value to the a element does not seem to have the desired effect for any value.
  • Calling window.location.replace opens the link in the sidebar instead of the currently active tab.
  • Getting the current tab by using browser.tabs.query and setting tab.url for the sole result does nothing (even though I have added the tabs permission to manifest.json).

At this point, I'm kind of thinking this might not be possible. Is this the case?

3
  • Use browser.tabs.update
    – woxxom
    Commented Mar 21, 2022 at 4:47
  • @wOxxOm Somewhat surprisingly that actually works. Thanks! If you'd like, you could post this as an answer instead, so I could accept it.
    – Xiyng
    Commented Mar 22, 2022 at 2:13
  • There's an existing answer for chrome, but it's conceptually the same.
    – woxxom
    Commented Mar 22, 2022 at 5:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.