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

Add user agent exclusion list for whether or not to do mobile redirection (to exempt tablets from redirection) #5387

Closed
westonruter opened this issue Sep 15, 2020 · 3 comments
Labels
Enhancement New feature or improvement of an existing one Groomed Needs sizing P2 Low priority Punted WS:Core Work stream for Plugin core

Comments

@westonruter
Copy link
Member

Feature description

Some users may only want to redirect mobile visitors to the AMP version, as the "mobile redirection" implies. Nevertheless, the the user agent list currently used for redirection will match tablet devices as well:

$default_user_agents = [
'Mobile',
'Android',
'Silk/',
'Kindle',
'BlackBerry',
'Opera Mini',
'Opera Mobi',
];

In particular, the user agent for "Mobile" will end up matching Safari on iPad, for example:

Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148

And “Android” will match any Android tablet.

This being the case, maybe we should introduce an exclusion list of user agents in addition to the current inclusion list of user agents. Redirection would only be performed if the user agent does not match the exclusion list and it does match the inclusion list.

Currently the inclusion list is filtered by amp_mobile_user_agents.

The exclusion list could be filtered via amp_non_mobile_user_agents.

It seems necessary to introduce an exclusion list rather than to make the agents in the inclusion list more restrictive, as it is very difficult to construct a regular expression that matches mobile but not tablet at the same time. (If I'm wrong, please enlighten me!)

What then remains to be seen is whether tablets should redirect by default or not. In other words, should the exclusion list in amp_non_mobile_user_agents be initially populated with common tablet user agents? Or should it be empty, requiring users to add the PHP filter to prevent certain user agents from redirecting.

Originally discussed in a support topic.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@westonruter westonruter added Enhancement New feature or improvement of an existing one WS:Core Work stream for Plugin core labels Sep 15, 2020
@westonruter westonruter added this to the v2.1 milestone Sep 29, 2020
@westonruter
Copy link
Member Author

Relates to #5293 in how it may need to be added to the settings screen.

@kmyram kmyram added the 3sp label Oct 6, 2020
@westonruter westonruter modified the milestones: v2.1, v2.2 Feb 11, 2021
@westonruter westonruter added the P2 Low priority label Jun 18, 2021
@westonruter westonruter removed this from the v2.2 milestone Jun 18, 2021
@westonruter
Copy link
Member Author

Removing from milestone since nobody has requested this other than one user in a support topic.

@westonruter
Copy link
Member Author

This has only been asked for once.

@westonruter westonruter closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2023
@github-project-automation github-project-automation bot moved this to To Do in Ongoing Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or improvement of an existing one Groomed Needs sizing P2 Low priority Punted WS:Core Work stream for Plugin core
Projects
Archived in project
Development

No branches or pull requests

3 participants