Joomla 4 popup window.opener Topic is solved

This forum is for general questions about extensions for Joomla! 4.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
ron4mac
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sat May 15, 2010 12:52 pm

Joomla 4 popup window.opener

Post by ron4mac » Fri Sep 30, 2022 3:52 pm

I've come to a dead end on trying to solve an issue I am having with J4. I have an editor plugin that I wrote that has always worked fine with J3. For file management, it opens a small popup window that provides file selection/management. It communicates the file selection back to the editor javascript via the window.opener window object link. With J4, the window.opener value is null. The case is the same whether associated with the editor or not (i.e. a simple button on a page that opens a simple blank popup). I've explored all sorts of possible cross-origin issues and window.open() parameter values but have not discovered a why or solution. I would greatly appreciate any wisdom that anyone in the community could provide.

User avatar
ceford
Joomla! Ace
Joomla! Ace
Posts: 1358
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Joomla 4 popup window.opener

Post by ceford » Fri Sep 30, 2022 6:12 pm


ron4mac
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sat May 15, 2010 12:52 pm

Re: Joomla 4 popup window.opener

Post by ron4mac » Sat Oct 01, 2022 3:35 pm

My problem was being caused by the default settings of the system http headers plugin. I solved it by overriding the header in the invocation of my editor plugin (__construct).

Code: Select all

$app = Factory::getApplication();
$app->setHeader('Cross-Origin-Opener-Policy', 'same-origin-allow-popups', true);


Post Reply

Return to “Extensions for Joomla! 4.x”