Feature Request: Open Web Links in Default Browser

I wonder if there’s a way to configure Tinderbox to open web links in the default browser when clicking them from the “Preview” tab.

I’m using Tinderbox for various project management tasks, and, as you can imagine, many of my notes reference web pages in external systems, including JIRA and Confluence. These tools do not support Tinderbox’s internal “preview” browser.

One idiosyncrasy of my notes is that many are authored using Markdown and, therefore, use Markdown’s link syntax, particularly reference-style links. Because I’m using Markdown, the web links are not “live” and clickable in the “Text” pane.

TL;DR: Is there a way to force Tinderbox to open external weblinks in the default browser from the “Preview” pain? If not, could we add this request to the “spike”? :pray:t3:

1 Like

If you set the note (not the template) to use Markdown—see Markdown preview rendering—then it should work.

1 Like

Hi @mwra I’ve tried this and changing it to Markdown does not seem to work. The clicked link still opens up in preview. I think this is a new feature request.

@JacobIO I so want this behavior…as soon as I saw your question, I thought, OMG, that is exactly what I’ve been wanting but was never able to vocalize the need so clearly. Thanks for raising it. I’ll post the request in the backstage.

1 Like

Ah, it sounds most likely an (unintended) security barrier. I did previewing some aTbRef notes in-app and which I know have web links. As the file export rather then uses hidden in-app previews I thought the links might work. They don’t.

My hunch is the internal (WebKit) browser may not (currently!) be allowed to link out of the app due to security/permissions issues. That’s just the possible ‘why’. I’d agree thad letting external (to the TBX document) use the user’s default web browser would be useful if it can be allowed. :slight_smile:

These tools don’t work with WebKit?

Would it be acceptable to require a right-click to Open Link In New Window, which would open the link in a new default browser?

Would using Tinderbox’s streaming support for Marked2 be a useful approach?

Yes, absolutely! Actually, that was the first thing I tried to see if it would work, so for me, the muscle memory is there. :slight_smile:

Yes, if we could achieve the same results by either right-clicking and selecting “Open Link In New Window” OR ⌘ Command + Click(ing) a link, that would be super! My “muscle memory” is to use the ⌘ Command + Click action.

They do, but I’m guessing TBX is sending a user agent that’s unknown to them, so they throw up an error.

We’re using the default macOS user agent. There’s an API to override that we could try, I suppose; I’m not a big fan of that sort of spoofing. Still…

1 Like

Just chiming in to add my +1 to this, for the same reasons as articulated above

2 Likes

Would it be acceptable to specify new as the value of the link’s target? That works out of the box.

Sure, but how would we “specify”? Write it like <a href=“https://www.eastgate.com” target=“new”>visit</a>?

How would we do it for a markdown syntax? [ ]()?

I don’t think there’s a way to specify a target using Markdown. However, I think I could craft a sed command to manipulate the piped output from the Markdown command. I’ll give that a try and report back.

Look like Pandoc supports the following [Visit Example](https://example.com){target="_blank"}; the Pandoc parser will take the extension and add in the target.

1 Like

My only quibble with this approach is that it would also affect the link behavior of exported HTML. Typically, when I export from Tinderbox, I do not want my notes’ external web links to open in a new tab/window. Is there a way to suppress this behavior on export but keep it when interacting with the Preview pane?

Sure. One simple way would be to add a small bit of javascript to your Preview template, but not to your Export template. The javascript would walk through the DOM and modify <A> tags to give them a target. This sort of thing is very common — you can probably find it on stack overflow or ask ChatGPT.

2 Likes

In fairness to the developer, preview is intended … to preview the exported HTML experience. Making the two behave differently is not exactly trivial as ‘just’ fixing that may break the user experience (UX) of those who do want the same result in each case. No error there on anyone’s part but I’m just flagging up the easily overlooked issue of the effects of our desired ‘simple’ changes to the app on the UX for other users without the same need.

1 Like

Sure, that might work. Just so I’m clear, is this supposed to work now, e.g., <a href="https://www.identitypraxis.com" target="new">Identity Praixs</a> if I put this in text and click on it in preview and have it open in the default browser, or 1) am I doing something wrong, or 2) an update needs to be made first? Right now, this does not open up in a new browser for me.

This is a great idea that hadn’t occured to me. Thank you!

I get that, @mwra. I’m a trained software engineer and serve currently as a technology executive, so I appriciate, probably better than most, the various tradeoffs when considering feature requests.

If you look at the original post, I asked that this be configurable. I am not asking for the current behavior to change for all users.

2 Likes