Hello there! I am getting some unexpected behavior from the (open-url:) macro in Harlowe. I’m using the standalone Twine 2.0 editor, and I’m getting the same behavior in the built-in webkit browser, in Firefox, and in Chrome.
Here's a sample of the kind of code that is acting up:
(link: "Psalm 29")[(goto-url: ""
https://www.biblegateway.com/passage/?search=Psalm+9&version=CEB"
]
When the link is clicked, the URL indeed opens in a new tab/window, just as expected. However, the link text disappears and “[object Window]” appears.
If I change (link:) to (link-reveal:), the words “Psalm 29” become plain text (as expected with (link-reveal:)) but “[object Window]” appears immediately thereafter, so the result is “Psalm 29[object Window].”
I’ve been working on this story for quite some time and I don’t remember seeing this behavior previously. I certainly never noticed the “[object Window]” before. Advice?
Comments
The (goto-url:) macro will replace the content of the current web-browser tab with the content of the referenced URL, so if the URL is valid you should not see the [object Window] text.
By default when the link created by a (link:) macro is clicked it replaces the Link Text with the text (String) output of the associated hook, in this case that text is the String representation of the window object being used to open the URL.
I could not replicate your error using the (goto-url: ) macro but I could using the (open-url: ) macro. If you plan on using the (open-url:) macro then the following CSS can be used to hide the [object Window] output, place it within your story's Story Stylesheet area.