User Tools

Site Tools


harlowe:open-url

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

harlowe:open-url [2017/10/09 20:39]
harlowe:open-url [2017/10/09 20:39] (current)
Line 1: Line 1:
 +**(open-url:​ // [[harlowe:​String|String]]//​) -> //​[[harlowe:​Command|Command]]//​**
  
 +When this macro is evaluated, the player'​s browser attempts to open a new tab with the given
 +URL. This will usually require confirmation from the player, as most browsers block
 +Javascript programs such as Harlowe from opening tabs by default.
 +
 +=== Example usage: ===
 +
 +''​%%(open-url:​ "​http://​www.example.org/"​)%%''​
 +
 +=== Details: ===
 +
 +If the given URL is invalid, no error will be reported - the browser will simply attempt to
 +open it anyway.
 +
 +Much like the ''​%%<​a>​%%''​ HTML element, the URL is treated as a relative URL if it doesn'​t start
 +with "​http://",​ "​https://",​ or another such protocol. This means that if your story file is
 +hosted at "​http://​www.example.org/​story.html",​ then ''​%%(open-url:​ "​page2.html"​)%%''​ will actually open
 +the URL "​http://​www.example.org/​page2.html"​.
 +
 +=== See also: ===
 +
 +[[harlowe:​goto-url|(goto-url:​)]]
harlowe/open-url.txt ยท Last modified: 2017/10/09 20:39 (external edit)