If a top-level navigation to an http:// or https:// URL is blocked by administrator (blocklisted), then we navigate to the equivalent cloud: URL.
NOTE: the admin dashboard implementation should automatically add cloud: URLs to the URLWhitelist policy. This should be a default and un-editable policy, at least until we add the implementation for pages that can be blocked on cloud as well. This is because a URLBlacklist policy of * will also block cloud: URLs and mess everything up. ((This is probably relevant to @mingy98 and maybe @owenniles for admin dashboard creation))
Implementation
Use the chrome.webNavigation API to detect when an error by administrator blockage occurs and then navigate to the cloud URL.
Documentation & Tests Added
N/A
Testing Instructions
Create a dummy policy at /Library/Managed Preferences/<username>/com.whisttechnologies.whist.development.plist and fill it with
This dummy policy blocks all URLs except for those starting with cloud: and wikipedia.org. If you navigate to any blocked website (anything other than wikipedia.org), it should redirect to a cloud URL.
PR Checklist
[ ] Did the PR author fully test this PR end-to-end?
[ ] Did one PR reviewer fully test this PR end-to-end?
[ ] Did one PR reviewer conduct a thorough code design review?
Ticket(s) Closed
N/A
Description
If a top-level navigation to an
http://
orhttps://
URL is blocked by administrator (blocklisted), then we navigate to the equivalentcloud:
URL.NOTE: the admin dashboard implementation should automatically add
cloud:
URLs to theURLWhitelist
policy. This should be a default and un-editable policy, at least until we add the implementation for pages that can be blocked on cloud as well. This is because aURLBlacklist
policy of*
will also blockcloud:
URLs and mess everything up. ((This is probably relevant to @mingy98 and maybe @owenniles for admin dashboard creation))Implementation
Use the
chrome.webNavigation
API to detect when an error by administrator blockage occurs and then navigate to the cloud URL.Documentation & Tests Added
N/A
Testing Instructions
Create a dummy policy at
/Library/Managed Preferences/<username>/com.whisttechnologies.whist.development.plist
and fill it withThis dummy policy blocks all URLs except for those starting with
cloud:
andwikipedia.org
. If you navigate to any blocked website (anything other than wikipedia.org), it should redirect to a cloud URL.PR Checklist