Web Viewer: Add `Reuse same tab when opening` & `Focus on tab when opening` options

Use case or problem

I’d love to use the Web Viewer core plugin for a specific task but there are missing options that prevent me from doing so: The ability to silently open web pages in the same tab every time.

I use Obsidian for multiple purposes, one of which is as a jukebox/music player. Over time, I’ve referenced quite a few URLs (especially from YouTube) and launch their respective service when clicking on them.

On mobile, it opens the app or falls back to a web page if the app isn’t installed. It’s not ideal but I can’t do much to improve that. On desktop though, the current Web Viewer behavior doesn’t fit that use case very well.

To solve this issue, I disable the Web Viewer and use the Surfing community plugin instead to open URLs in the background. To clarify, when I click on a link for the first time, it opens the Surfing tab. Then, I drag and drop the tab to open it as a standalone window, which I minimize on a second screen. After that, when I click on other links, they open in the same minimized window, and the audio plays directly without focusing on the tab.

This method works fine, but the plugin hasn’t been updated since the release of Web Viewer (understandably), and it doesn’t detect URLs in certain contexts, such as when rendered in custom views:

For this reason, among others, I’d prefer to use Web Viewer instead.

Proposed solution

Two new options would be available:

  • Reuse same tab when opening (default: false)

  • Focus on tab when opening (default: true)

When toggling them both (true & false), then clicking a link anywhere in the app would open the web page in the current tab holding the web viewer without focusing on it.

Current workaround (optional)

What I’ve described with Surfing plugin

Related requests

Hi, I’m the author of the post you linked as related.

I ran into the same issues and patched my fork so it also uses a Surfing window with links generated from Dataview or Bases. It’s here → https://github.com/jldiaz/Obsidian-Surfing/releases/tag/v0.9.14-jld2 and for now it can only be installed with BRAT.

It’s a fork for my own private use, and it works for me, but I don’t really understand everything I did (Claude helped me), so I can’t commit to providing support. I made a PR to the main repository, but I haven’t received a reply and I don’t think I will.

In the meantime, it might be useful to you.

1 Like

I wasn’t interested in the fragment functionality you described, so I didn’t bother to check out your repository. What a mistake :see_no_evil_monkey:

The only thing missing now is handling URLs in the file properties section & panel. However, I can live without it, as it already handles dynamic views, such as virtual content output.

I used to clutter up my music files with meta-bind expressions rendering URLs to compensate for the fact that Surfing wouldn’t work otherwise. I’m free from this madness now! Thank you very (very) much :folded_hands:

I’ll leave this feature request open, as I think it could also be beneficial for the core plugin.

1 Like