How to best deal with captive portals and outdated browser

An attempt to solve issues with captive portals in easy way:

CPH

Due to testing limited opportunities a feedback is welcome.

3 Likes

I did not try it but looked at the code. To me it looks like it will try to reach a http server on the first “nameserver” entry found in resolv.conf. This can potentially help but seems wrong.

In case one can see multiple “nameserver” entries, how would one be sure to choose the WiFi one?
The assumption that the portal is on the same IP as DNS might not be true for every network, probably especially those with demanding portals.

No, this is the idea.

Every nameserver is the WiFi one. This file is created by connmand from DNS provided by WiFi DHCP. Should someone edited it manualy then he surely knows what to do.

No, captive portal should not be on the same IP but captive portal have to allow DNS IP that provides to connect to. It is enough to redirect this request to captive portal page.
I strongly suggest you to test it.

1 Like

I am not using sailfish OS any longer. Except for playing around at home, where captive portals are no issue and the device has no SIM which probably makes tests rather unrealistic.

I also had resigned regarding SF browser and therefore installed Fennec from F-Droid. Fennec also includes direct installation of uBlock Origin out of the box in Extensions menu. Now I have a full functional browser on Sailfish device.

1 Like

As discussed before Android browsers will not help to visit and pass portals. They will show “no internet” instead of the portal.

It means that you are wasting my time.

2 Likes

OK, if an access point’s captive portal requests the browser, and Sailfish Browser launches.
This is surely done by a ‘terminal’ command like ‘sailfish-browser’ or the full
‘/usr/bin/invoker --type=browser,silica-qt5 -A – /usr/bin/sailfish-browser %U’, as it’s written in the ‘/usr/share/applications/sailfish-browser.desktop’ flie.

Q1: What is the cli command to start Fennec by cli?
Q2: Where is the launcher command defined that a captive portal sends to open the browser?

Goal is to force captive portals to open Fennec and not the outdated stock browser.

I can’t find the .desktop files for Android apps! Where are they?

/home/defaultuser/.local/share/applications

1 Like

I suggest you try Fennec for a portal, or maybe 3 different ones, manually first. You will likely not want to make it the default portal browser after that experiment.

When trying the same portal with multiple browsers, make sure to change your MAC before each attempt.

And there is the file:
apkd_handler_org_mozilla_fennec__fdroid-org_mozilla_fenix_HomeActivity.desktop

that contains the line (Exec):
apkd-launcher -d %U org.mozilla.fennec_fdroid.apk org.mozilla.fennec_fdroid/ org.mozilla.fenix.HomeActivity

and if I C+P this into terminal, Fennec starts.

So I think, it should be possible to change the command that normally launches SF Browser to a command that launches Fennec (or another Android browser) to do this captive portal thing with capable browser.

Remains question: Where (in what file) is defined, what happens if a request for captive portal comes?
Idea is to change the launcher command for SF browser to launcher command for Fennec (or other capable Android browser).