Add Captive Portal auto-refresh handling
Needs RevisionPublic

Authored by broulik on Fri, Nov 22, 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.Fri, Nov 22, 4:43 PM
Restricted Application added a project: Plasma. · View Herald TranscriptFri, Nov 22, 4:43 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Fri, Nov 22, 4:43 PM
broulik edited the test plan for this revision. (Show Details)Fri, Nov 22, 4:51 PM
fvogt requested changes to this revision.Mon, Nov 25, 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.Mon, Nov 25, 12:36 PM