Bug #62503
closedChrome opens a new window instead of a tab on "save and close"
100%
Description
Browsers started to distinguish how opening a new window
from JavaScript happens. They track "user initiated"
opening and not user initiated opening and behave differently.
A request to open a window by JavaScript which is not
user initiated is caught by a pop up blocker most of the time nowadays.
This means a user must explicitly allow the current page to
open new windows by JavaScript.
Additionally some browsers (e.g. Chrome) always open a new window
instead of a new tab if the request is not user initiated, regardless
of browser settings, which nowadays default to open a new tab.
The "save and preview" button currently initiates a page reload
which saves the document and add some JavaScript to to open a preview
window in the HTML response of this action.
This JavaScript action is then not considered to be user initiated any more
as opening the new window does not follow a direct user click action.
The result is, that if a preview window/tab was opened previously, then
the preview/window tab is just reloaded with the new preview URL.
If it is the first time the window/tab should be opened this request
is caught by the popup blocker.
Other preview buttons in the backend (from Click Menu or action toolbar)
behave differently (correctly) as they are always identified as user initiated.
For that reasons, change the "save and preview" button to directly
open a new window on click (without URL) and let the HTML/ JavaScript response
set the correct preview URL after that.
By doing so we gain a consistent behavior no matter what preview button a user
clicks first.
The only downside is, that in case the preview window is opened
the first time, it remains empty until the page is saved and then reloaded
through the JavaScript code that is already present.
See http://stackoverflow.com/questions/15818892/chrome-javascript-window-open-in-new-tab for a detailed description about browser behavior.
Updated by Gerrit Code Review about 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33576
Updated by Gerrit Code Review about 10 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33590
Updated by Helmut Hummel about 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ae1bdc3fe465c6cc9ee35951e3946de478b9ac63.