Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get transceiver to QSY - Safari #25

Open
fred-corp opened this issue Dec 24, 2024 · 6 comments
Open

Can't get transceiver to QSY - Safari #25

fred-corp opened this issue Dec 24, 2024 · 6 comments

Comments

@fred-corp
Copy link

fred-corp commented Dec 24, 2024

"

Features

  • When clicking on a spot in WaveLog-Bandmap your TRX with QSY to the Spot.

"

When using WaveLogGate with FLRig, an ICOM IC-7300, and my WaveLog instance (all latest releases), the transceiver doesn't jump to the frequency of the spot I click on in the band map..

Is there something I have to configure on my WaveLog Server or a port I have to forward for this to work ?

@int2001
Copy link
Contributor

int2001 commented Dec 29, 2024

Wavelog calls WavelogGate on localhost (via your Browser, not via the server) to QSY. WavelogGate forwards it to FLRig.

It's important that a connection to localhost:54321 (where WavelogGate listens) from your local(!) browser is possible.

@fred-corp
Copy link
Author

fred-corp commented Dec 30, 2024

Ah I found the issue; when I go to for example http://127.0.0.1:54321/14212000, the transceiver jumps to the correct frequency. However, when I click on a spot, I get the following error in the javascript console :

Screenshot

My URL still says "CloudLog", but I've migrated to WaveLog

I'm using Safari on macOS, maybe it's a permission issue; I'll see if I can allow the request in Safari's settings

@fred-corp
Copy link
Author

fred-corp commented Dec 30, 2024

It seems that Safari is the only browser to not allow cross origin websites, even for local loopback addresses, and with no way to enable that in the settings...

I made a temporary fix in the bandmap's JavaScript :

bandmap_list.js line 219

//irrelevant=fetch(CatCallbackURL + '/'+qrg);
var temp = window.open(CatCallbackURL + '/'+qrg);
temp.addEventListener('load', function() { temp.close(); } , false);

Basically opening a new window, and closing it once it has loaded. This works quite well ! Only issue is that I can see the window opening and closing, but it's not that big of a deal.
Maybe a solution can be to detect if the client is a Safari browser, and do this shenanigan if it's the case, or load the local URL in an invisible iframe ?
Or maybe WaveLogGate could use HTTPS with a self-signed certificate ?

I know not a lot of users will be on Safari, so no worries if you don't want to put in the effort :)
I'll try some solutions I proposed when I get the time, and create a PR once it's done

@fred-corp fred-corp changed the title Can't get transceiver to QSY Can't get transceiver to QSY - Safari Dec 30, 2024
@int2001
Copy link
Contributor

int2001 commented Dec 31, 2024

you have to import the self-signed cert to your browser, if one adds SSL to WavelogGate. This would cause massive problems on all browsers.

detection of safari and doing some iframe-vodoo could(!) be a solution. let me know if there's progress

@fred-corp
Copy link
Author

I trier using an iframe, but the issue persists as the request is still coming from the https page.

The solution I have still seems to be the best option :

bandmap.listline 219 :

            function isSafari() {
                return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
            }
            
            if(isSafari()) {
                var temp = window.open(CatCallbackURL + '/'+qrg);
                temp.addEventListener('load', function() { temp.close(); } , false);
                setTimeout(function () {
                if (temp && !temp.closed) {
                        temp.close();
                    }
                }, 500);
            }
            else { 
			    irrelevant=fetch(CatCallbackURL + '/'+qrg);
            }

The code checks if the client is using Safari; if yes the pop-up workaround is used, if not the fetch function is used

@HB9HIL
Copy link
Contributor

HB9HIL commented Dec 31, 2024

To be very honest: I think such a function is difficult to maintain since there are so many different possible setups.

In my eyes it would be much easier and safer to clearly communicate that Safari is not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants