The default behavior for hyperlinks is to open in the same tab if they point to the same origin (protocol + subdomain + domain) as the current notebook URL, and open a new tab otherwise. Compare e.g.
Hyperlink["Wolfram", "https://wolfram.com"]
to
Hyperlink["Another cloud object", "https://www.wolframcloud.com/objects/jpoeschko/HelloWorld.nb"]
the latter will open in the same tab if you're viewing the notebook at www.wolframcloud.com ("the deployed view") as well (whereas it will open in a new tab if you're looking at the notebook at develop.wolframcloud.com).
If you want lower-level control of this, you can use NotebookLocate and the option "OpenInNewWindow"
(unfortunately undocumented, as of now):
Button["Open in same tab", NotebookLocate[{URL["https://wolfram.com"],Null}, "OpenInNewWindow"->False]]
will always open in the same tab, regardless of the relation between source and target origin. You can also specify True
to force a new tab.
There are two changes in the pipeline that will make this more straight-forward:
- We'll deprecate the various product-specific subdomains so everything will be at www.wolframcloud.com (/obj for the deployed view, /env for the "environment" / edit view), as part of a bigger effort to simplify our product/license offering (coming soon). Of course, the old URLs will keep working as a courtesy. Once you're always working under www.wolframcloud.com, it makes the hyperlink behavior more predictable.
- We're working on revamping the hyperlink dialog and related functionality under the hood (also on desktop), so there will be more convenient control of whether to open a new tab or not. This is a bit further out.
Hope this helps. Let me know if you have any further questions.