Project

General

Profile

Actions

Bug #105104

closed

Preview button in page module does not focus() preview browser tab/window if same resource

Added by Claus Due about 2 months ago. Updated 18 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
-
Start date:
2024-09-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
trivial
Is Regression:
Sprint Focus:

Description

In window-manager.js a special condition is added which checks if the browser is trying to open a URL that is already open when a user clicks the "view" button in the page layout module header.

If this is the case, a special logic path is used which reloads that other tab/window's URL - instead of calling window.open().

Unfortunately, this special logic path does NOT call focus() on the target window like the standard code path will do.

The result is that if you're clicking the "view" button but already have a window/tab open with that resource, then that other window/tab is reloaded but is not focused.

(this problem does not exist for the "view" button in the formengine edit form which uses a completely different method for opening the new window/tab).

The behavior should be consistent regardless of which "view" button is clicked and whether or not a window/tab already exists. The good UX solution appears to be that both code paths in window-manager.js should call focus() on the target window.

Code in question:

if (Utility.urlsPointToSameServerSideResource(n, l)) return i.location.replace(n), i.location.reload(), i;

Suggested replacement:

if (Utility.urlsPointToSameServerSideResource(n, l)) return i.location.replace(n), i.location.reload(), i.focus(), i;
Actions

Also available in: Atom PDF