How to Open the Latest Web Viewer (v1.8.3) Programmatically?

Hi everyone!

I’m working on a custom Obsidian plugin and would like to programmatically open the latest version of the Web Viewer core plugin (v1.8.3). My goal is to create a new Web Viewer tab and load a specified URL through code.

Is there any API like this?

this.app.workspace.openUrl("https://example.com");

Thanks

The regular JS API window.open("https://example.com") will automatically open the page in the web viewer, if it’s disabled it will load in the default browser instead.

1 Like

Cool, thanks a lot.

This method will pop up a new window, is there any way to open it in a new tab?
@joethei

1 Like