Author Topic: Window opens in Separate Window  (Read 305 times)

0 Members and 1 Guest are viewing this topic.

jx12345

  • Full Member
  • ***
  • Posts: 9
Window opens in Separate Window
« on: November 16, 2021, 04:43:59 PM »
Hi, wondered if anyone might be able to help. I've installed mibew on my local test server and it opens up in the popup/iframe box but when i've installed it on my live server the chat window opens in a separate window. When generating the button I don't have the Use Window box ticked and the generated button code has preferIFrame: true.

Any help much appreciated.

On the servers where the chat won't render in the popup/iframe I seem to get a 404 on cookies-set-permission?rnd=0.214123.. and an error in chat_popup.js

Again any help or pointers greatly appreciated
« Last Edit: November 17, 2021, 10:33:16 AM by jx12345 »


faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 932
    • Mibew Messenger
Re: Window opens in Separate Window
« Reply #1 on: November 17, 2021, 02:12:05 PM »
Hi,

You didn't specified information about software versions, but I presume, that you're talking about Mibew Messenger 3.5.x and some modern Webkit-based browser.

The short answer: everything works as intended. Mibew Messenger just falls back to window-based chat, because otherwise it will be completely unworkable. The problem is related to "privacy"-related changes to handling of cookies implemented by Google. See the appropriate issue for more info.

jx12345

  • Full Member
  • ***
  • Posts: 9
Re: Window opens in Separate Window
« Reply #2 on: November 17, 2021, 02:56:31 PM »
Hi,

Many thanks for your response. Apologies for not including software versions.

I'm using Mibew 3.5.2 - the link you included seems to suggest it was fixed in 3.5.0? Perhaps it is not the same issue?

I have two local test machines - Ubuntu 20.04.3 LTS Virtual Machine in Virtual Box on Win10 the other is CentOS 7.9 both running Apache & PHP 7.4.x

Both of these allow the popup\iframe to run find when viewed in the following browsers:

Chrome Version 96.0.4664.45 (Official Build) (64-bit) Win10
Firefox 94.01 (64-bit) Win 10

Firefox 91.03.0esr (64-bit) CentOS 7.9

But the same browsers (and several others) show the live site (A VPS running Ubuntu 20.04.3 LTS, Apache & PHP 7.4) only with the windowed chat

I have also tested on another test VPS (CentOS 7.6, Apache, PHP 7.2) and again it only runs in the windowed chat with the same 404 error on the cookies-set-permission call.

Again any help would be greatly appreciated - we're finding that users are struggling to use it in the windowed chat as they 'lose' it behind the website page and don't know how to get back to it!

Thanks, again,
J

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 932
    • Mibew Messenger
Re: Window opens in Separate Window
« Reply #3 on: November 18, 2021, 10:27:23 AM »
I'm using Mibew 3.5.2 - the link you included seems to suggest it was fixed in 3.5.0? Perhaps it is not the same issue?

No, it's the very same issue. I'm afraid you don't get the point. The case when Mibew falls back to window-based mode is not an issue, it's a solution for the issue, because it's the only way for Mibew to be able to work when it's impossible to set cookies in iframe-based mode. And the 404 errors you see is the result of the check of possibility to set a cookie. See the code.


Again any help would be greatly appreciated - we're finding that users are struggling to use it in the windowed chat as they 'lose' it behind the website page and don't know how to get back to it!

At the moment there are two possible ways:

1. One could use the same domain for Mibew Messenger and the site. They could be used on different subdomains, but the basic domain should be the same. Otherwise cookies in iframe will be treated as third-party and could be blocked in browser due to privacy setting (which is obviously impossible to change from aside) despite being marked as SameSite=None.

2. One could somehow convince users to allow third-party cookies for Mibew Messenger.

jx12345

  • Full Member
  • ***
  • Posts: 9
Re: Window opens in Separate Window
« Reply #4 on: November 18, 2021, 10:36:42 AM »
Many thanks again for your patience and support

Quote
At the moment there are two possible ways:

1. One could use the same domain for Mibew Messenger and the site. They could be used on different subdomains, but the basic domain should be the same. Otherwise cookies in iframe will be treated as third-party and could be blocked in browser due to privacy setting (which is obviously impossible to change from aside) despite being marked as SameSite=None.

But they are on the same domain (or am I still missing something)!?

I appreciate you can't really provide direct support but i have a very basic example that has mibew installed on the same domain as the site just at /mibew and it still reverts back to the windowed chat.

Forgive me if I'm missing something basic here and thanks again for your time.


« Last Edit: November 18, 2021, 07:02:30 PM by jx12345 »

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 932
    • Mibew Messenger
Re: Window opens in Separate Window
« Reply #5 on: November 18, 2021, 05:04:08 PM »
Oh... Looks like I've got what this all about. Please wait a couple of days, so I can implement and test a solution.

jx12345

  • Full Member
  • ***
  • Posts: 9
Re: Window opens in Separate Window
« Reply #6 on: November 18, 2021, 07:04:21 PM »
Ok, great, many thanks.

If there's anything I can do to help in testing or otherwise please just let me know.

Also, I'd be really interested to understand the issue if you're able to explain it to me - I've spent a while really trying to understand why it behaves the way it does.

Thanks again

J

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 932
    • Mibew Messenger
Re: Window opens in Separate Window
« Reply #7 on: November 19, 2021, 11:39:23 PM »
If there's anything I can do to help in testing or otherwise please just let me know.

In fact you can. :)

Please test the fix attached to this post. If everything will work correct, I'll publish a new release in the near future.

Also, I'd be really interested to understand the issue if you're able to explain it to me - I've spent a while really trying to understand why it behaves the way it does.

As far as I understand (but it has to be tested) the issue in question is a result of invalid detection of second level domain when setting cookies on a client side. There are a lot of special cases, so that's why Mozilla maintains the public suffix list.

jx12345

  • Full Member
  • ***
  • Posts: 9
Re: Window opens in Separate Window
« Reply #8 on: November 22, 2021, 10:43:53 AM »
Many thanks for issuing the update so quickly.

I'm afraid I am now getting the following errors:

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 932
    • Mibew Messenger
Re: Window opens in Separate Window
« Reply #9 on: November 22, 2021, 05:58:25 PM »
If you're absolutely sure that you've replaced existing files and added new files from the attached archive into your installation, then some old code has been cached either in your browser, or somewhere on a server side (maybe some proxy). Restart web server, use incognito mode in a browser.

The link you've provided is dead, so I'm unable to determine the problem myself.

jx12345

  • Full Member
  • ***
  • Posts: 9
Re: Window opens in Separate Window
« Reply #10 on: November 24, 2021, 11:50:51 AM »
Apologies for delay in reply. I've tried this several times and on a fresh installation to try and ensure I'm not doing anything wrong but I seem to continue to get the same error.

Just to confirm, in the update there are two updated files:
mibew/js/compiled/chat_popup.js
mibew/libs/classes/Mibew/Controller/AbstractController.php

And one new file:
/mibew/js/vendor/psl/dist/psl.min.js

I've added these to a new installation (adding **updated** in the comments at the top of chat_popup.js so as to confirm the browser isn't caching the old one)

And I still receive the following errors:
chat_popup.js:18 Uncaught ReferenceError: psl is not defined
    at chat_popup.js:18
(index):5 Uncaught TypeError: Cannot read properties of undefined (reading 'init')
    at (index):5

There's a live example of this at the following url:

http://jx7.co.uk/

Again, many thanks for your continued support and assistance.
« Last Edit: November 24, 2021, 11:52:32 AM by jx12345 »

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 932
    • Mibew Messenger
Re: Window opens in Separate Window
« Reply #11 on: November 25, 2021, 11:51:46 AM »
Yeah, I see... Ok, have to think again...

jx12345

  • Full Member
  • ***
  • Posts: 9
Re: Window opens in Separate Window
« Reply #12 on: November 25, 2021, 11:53:34 AM »
ok, thanks again, just let me know if i can do anything

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 932
    • Mibew Messenger
Re: Window opens in Separate Window
« Reply #13 on: November 25, 2021, 05:22:39 PM »
Well, you can test the next fix (attached). :)

jx12345

  • Full Member
  • ***
  • Posts: 9
Re: Window opens in Separate Window
« Reply #14 on: November 29, 2021, 12:14:47 PM »
Yeah, that looks like it works!

Many thanks!