inter-window communication Topic is solved

Discussion regarding Joomla! 4.x security issues.

Moderators: mandville, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant / FPA - 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.
Locked
wetken
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Sep 11, 2017 11:20 am

inter-window communication

Post by wetken » Thu May 04, 2023 9:33 am

I use PHP and Javascript code within some pages to present forms to the user. I have drop-downs, augmented by pop-up windows presenting content to assist, or drive, the dropdown choices. In Joomla 3 I was able to write Javascript code in the pop-up windows and use window.opener functionality to allow the user to click in the pop-up and have that reflected in the main window drop-down. In my migrated site in Joomla 4 window.opener is always null in the pop-up window. Has J4 done something with PHP headers for COOP, or is this something handled by the template provider? I thought it might be a browser issue, but both Chrome and Firefox are happy to run the J3 code from https site, but neither will run J4 site code as I want.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 25042
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: inter-window communication

Post by pe7er » Thu May 04, 2023 10:58 am

wetken wrote:
Thu May 04, 2023 9:33 am
Has J4 done something with PHP headers for COOP, or is this something handled by the template provider?
Yes, Joomla 4 has a "System - HTTP Headers" plugin that can handle PHP headers.
You should also check the .htaccess because you can add HTTP headers there as well.
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

wetken
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Sep 11, 2017 11:20 am

Re: inter-window communication

Post by wetken » Sat May 06, 2023 8:47 am

The key to my issue seems to be to leave X-Frame-Options enabled and set Referrer-Policy to 'same-origin', but to set Cross-Origin-Opener-Policy to either 'Disabled' or 'unsafe-none'. Despite 50+ years of experience I am still finding areas of expertise about which I know just enough to be dangerous. My site is not public, and the likelihood that someone could both gain access and use an on-site pop-up to do something malicious is a risk I'm willing to take for the additional user convenience. Many thanks for not only replying at all, but also for your precision.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 25042
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: inter-window communication

Post by pe7er » Sat May 06, 2023 11:37 am

You're welcome!

You can still use Joomla's "System - HTTP Headers" plugin and tweak it for your website/server.
Switch all options off first.
Then enable them one-by-one, while refreshing your browser and checking the browser Console for any errors.
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com


Locked

Return to “Security in Joomla! 4.x”