Is there a way to reuse a Web Viewer tab instead of opening a new one?

When the core “Web viewer” plugin is enabled, clicking an external link always opens a new tab. I’d like to know if there’s a way (built-in or via a plugin) to make it reuse an existing Web viewer tab by updating its URL instead of creating a new one.

My use case:

  • I read EPUBs served from Calibre inside the Web viewer, and I can select text and “create a link” to it, that I can paste into my notes.
  • These Calibre-generated links share the same base URL, with only the fragment (#...) changing to indicate a location in the book.
  • Ideally, the viewer could detect this and just update the position, avoiding a full reload of the page/book.

I’ve already tried the “Vertical Tabs” plugin, which has an IDE mode that reuses tabs, but it doesn’t seem to work for Web viewer tabs, and it also doesn’t detect when the URL is the same (to skip reloading).

Current workaround:
I disable the Web viewer for these links and open them in my browser instead, using the Chrome extension “One Tab Only” to ensure they always reuse the same tab without reloading the book. It works, but I’d much prefer an integrated Obsidian solution.

Has anyone found a better workaround for this, or can confirm if it’s simply not possible right now?

Web Viewer isn’t currently offering many devoloper features. You should look Surfing community plugin and present your use case there (unless it already solves your problem).

1 Like

Thank you for the pointer!

This plugin solves indeed the problem of having a single tab. It does not reuse the already loaded page when only the fragment changes, but this is a minor issue.

Ok. I have a solution. I forked Surfing plugin to add to it a little logic that detects when the URL being open differs from the URL already open only in the fragment part.

I did a PR to the original Surfing repo, but I don’t know if it will be accepted. Meanwhile, if anyone wants to use my fork, I published a release which can be installed following these instructions:

Installation Instructions

Option 1 — Manual installation

  1. Go to Releases · jldiaz/Obsidian-Surfing · GitHub and download the files manifest.json, main.js and styles.css from there.

  2. Copy these files into a new folder inside your vault’s .obsidian/plugins/ directory, e.g.:

    <your-vault>/.obsidian/plugins/surfing/
    

    (you have to uninstall first the official surfing plugin)

  3. Restart Obsidian and enable the plugin in Settings → Community plugins.

Option 2 — Install via BRAT

  1. Install the BRAT plugin if you haven’t already.

  2. In BRAT’s settings, choose Add Beta Plugin.

  3. Enter this repository’s GitHub URL:

    https://github.com/jldiaz/Obsidian-Surfing
    
  4. BRAT will download the plugin into your vault and keep it updated from this fork.

  5. Enable the plugin in Settings → Community plugins.

NOTE: If eventually this change is accepted in the main Surfing repo, you’ll need to uninstall my fork before installing Surfing again.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.