Add Captive Portal auto-refresh handling
AbandonedPublic

Authored by broulik on Nov 22 2019, 4:43 PM.

Details

Reviewers
bcooksley
fvogt
jgrulich
Group Reviewers
Plasma
Summary

When configured to detect captive portals, NetworkManager prompts the user to log in by opening http://networkcheck.kde.org
A captive portal will redirect the user and once logged in, redirect somewhere else or back to networkcheck.
Currently, it doesn't automatically detect the fact that the user is now logged in and only notices after like 10 minutes.
With this patch, when a new tab is opened pointing to KDE networkcheck, whenever the tab completes a navigation, (after a short delay) NetworkManager is asked to re-check network connectivity to update network connectivity basically immediately once connected.
When user is then redirected back to KDE networkcheck, which just returns "OK\n", the tab is closed to not leave the user sitting at this empty OK page.

Test Plan
  • Setup my NM to use networkcheck.kde.org, connected to a wifi with captive portal, clicked "Log in" on the "you need to login" prompt, my browser opened, I agreed to terms, hit "Connect", got redirected to some welcome page
  • With this patch the exclamation mark on the icon goes away almost immediately after connecting
  • Previously it would stay there pretty much forever

Doesn't work on Firefox because there I get a created event with "about:blank" and then only an updated even with the captive portal URL. I can't detect there that I originally opened a "networkcheck.kde.org" tab.

Diff Detail

Repository
R856 Plasma Browser Integration
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Nov 22 2019, 4:43 PM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 22 2019, 4:43 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Nov 22 2019, 4:43 PM
broulik edited the test plan for this revision. (Show Details)Nov 22 2019, 4:51 PM
fvogt requested changes to this revision.Nov 25 2019, 12:36 PM

IMO this should be addressed outside of PBI instead:

  • If a captive portal is detected, call CheckConnectivity with a higher frequency (I've never had any issues with this, actually)
  • Instead of opening networkcheck.kde.org in the browser when clicking the "Log In" button, open a page which just closes itself
This revision now requires changes to proceed.Nov 25 2019, 12:36 PM
broulik abandoned this revision.May 18 2020, 2:52 PM