Configure the Hyperlinks to New Window as default #3430

Closed
opened 2026-02-05 06:41:36 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @adriangalbincea on GitHub (Jan 6, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hi, is there a way to change the default hyperlink window to New Window instead of Current Window?

Exact BookStack Version

v22.10.2

Log Content

No response

PHP Version

No response

Hosting Environment

Docker

Originally created by @adriangalbincea on GitHub (Jan 6, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Hi, is there a way to change the default hyperlink window to New Window instead of Current Window? ### Exact BookStack Version v22.10.2 ### Log Content _No response_ ### PHP Version _No response_ ### Hosting Environment Docker
OVERLORD added the 🐕 Support label 2026-02-05 06:41:36 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 22, 2023):

Hi @adriangalbincea,
There is no in-built option for this but it can be achieved via adding the following code in the "Custom HTML Head Content" customization setting:

<script>
	document.addEventListener('DOMContentLoaded', function() {
		var links = document.querySelectorAll('.page-content a');
		for (var i = 0; i < links.length; i++) {
			links[i].target = '_blank';
		}
	});
</script>

This custom hack is not officially supported but it should be quite stable and rarely ever break.

@ssddanbrown commented on GitHub (Jan 22, 2023): Hi @adriangalbincea, There is no in-built option for this but it can be achieved via adding the following code in the "Custom HTML Head Content" customization setting: ```html <script> document.addEventListener('DOMContentLoaded', function() { var links = document.querySelectorAll('.page-content a'); for (var i = 0; i < links.length; i++) { links[i].target = '_blank'; } }); </script> ``` This custom hack is not officially supported but it should be quite stable and rarely ever break.
Author
Owner

@adriangalbincea commented on GitHub (Jan 22, 2023):

Many thanks @ssddanbrown
I shall give it a try.

@adriangalbincea commented on GitHub (Jan 22, 2023): Many thanks @ssddanbrown I shall give it a try.
Author
Owner

@adriangalbincea commented on GitHub (Jan 22, 2023):

It works. Thanks!!!

@adriangalbincea commented on GitHub (Jan 22, 2023): It works. Thanks!!!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3430