Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Communicating HTTP and HTTPS windows with javascript and/or jquery [closed]

I didn't really find an answer to that question that fits my need so I decided to ask it here.

I have two javascript's scripts on two different chrome tabs I need them to communicate with each other.

I just need them to be able to exchange information. (status , etc...)

My problem is that one website is HTTP and one of them HTTPS. (at least that's what i think).

I tried the following: 1.Opening the window from the script (Can't control both windows using the script and doesn't let me because one is HTTP and one is HTTPS) 2.creating Cookies (Can't access another domain's cookies) 3.using postMessage (gives me an error that says failed to execute because the target doesn't match the origin)

I have searched for quite a while and couldn't find a solution.

What are my choices here? (These are two different tabbed windows in chrome). In your answer please provide an example as well.

description of postMessage error: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://*******') does not match the recipient window's origin ('https://*******').

Another approach might be that I create one script that will command these two windows at once , but i have no idea how to do it since I can't access the document property after opening a window.

like image 376
NotGI Avatar asked Feb 28 '26 04:02

NotGI


1 Answers

the target is on https, so you need to correct your target too to be on https, and how come you dont know what the other website is in, are you trying cross domain communication.. ?? Have a look at this AJAX cross domain call

this should help if i understand your problem correctly.

like image 79
Mebin Avatar answered Mar 01 '26 19:03

Mebin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!