Closed
Bug 1228547
Opened 9 years ago
Closed 9 years ago
Don't reset the UA when reloading tabs
Categories
(Firefox for iOS :: General, defect)
Tracking
()
VERIFIED
FIXED
1.3
Tracking | Status | |
---|---|---|
fxios | 1.3+ | --- |
People
(Reporter: csuciu, Assigned: n0-0ne+mozilla)
References
Details
Attachments
(1 file)
Build: 1303
1. Visit ziare.com
2. 'Request desktop site'
3. Reload the page, or tap on a link to open an article in the same tab
Result: The mobile version of the site is offered
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8693071 -
Flags: review?(bnicholson)
Comment 2•9 years ago
|
||
Probably needs a UX thought +CC :tecgirl
Comment 3•9 years ago
|
||
For clarification, Safari does not reset the UA on reload and continues to hold onto the desktop UA on new links clicked (except for opening links in a new tab). I suppose we should do that.
Comment 4•9 years ago
|
||
This does not work correctly.
In webView(webView: WKWebView, didFinishNavigation navigation: WKNavigation!) we are doing the following:
// Remember whether or not a desktop site was requested and reset potentially spoofed user agent
if #available(iOS 9, *) {
tab.desktopSite = webView.customUserAgent?.isEmpty == false
webView.customUserAgent = nil
}
This will always reset the custom user agent for the next request. I don't think that is the behaviour we want.
I think we want the same thing as Safari does, which is this:
* When you RDS, the current page is reloaded with a Desktop user agent
* When you open a new link in the same tab (that now has RDS enabled) for the *same* site, we need to stay in RDS.
* When you open a new link the same tab (that now has RDS enabled) for a *different* site, we need to reset RDS
So you need to keep track of the page URL and decide to disable RDS probably before each request starts in webView(webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void)
Here is a good test case:
1) Open a new tab
2) Load Github.com - See that it loads the mobile site
3) Enable RDS - See that it reloads and github.com is now the desktop version
4) Tap on a link in the navigation bar like 'Explore' - See that it loads the Desktop version
5) In the same tab, open http://github.com/Alamofire/Alamofire from the location bar - See that it loads the Desktop version
6) On the Almofire Github page, scroll down to the Communiation section and tap the link to Stack Overflow - See that RDS is reset and that SO opens in Mobile mode
Comment 5•9 years ago
|
||
Aaron, Safari does reset RDS if you go to a different web site on a tab where RDS is enabled. See test case above.
Updated•9 years ago
|
Attachment #8693071 -
Flags: review?(sarentz)
Comment 6•9 years ago
|
||
Comment on attachment 8693071 [details] [review]
Pull request
See my comment earlier. I think we need better Safari parity before this can land. I attached a good test case.
Attachment #8693071 -
Flags: review?(sarentz) → review-
Comment 7•9 years ago
|
||
(In reply to Stefan Arentz [:st3fan] from comment #5)
> Aaron, Safari does reset RDS if you go to a different web site on a tab
> where RDS is enabled. See test case above.
I meant links clicked through the same domain, however you are correct on the above as I just tested on my iPhone on Safari.
Assignee | ||
Comment 8•9 years ago
|
||
Thanks for the feedback on the pull request, Stefan. I think that always resetting the UA for the next request is exactly what we agreed on in Bug 1109675 (specifically in the comments on GitHub). But you are right in that it should be refined. I can look into updating the pull request with the suggested changes.
Comment 9•9 years ago
|
||
Comment on attachment 8693071 [details] [review]
Pull request
(In reply to hennes from comment #8)
> Thanks for the feedback on the pull request, Stefan. I think that always
> resetting the UA for the next request is exactly what we agreed on in Bug
> 1109675 (specifically in the comments on GitHub).
Yep, I was unfamiliar with Safari's behavior myself, so I apologize for not giving more direction in bug 1109675. But no worries -- I think your code that's already landed was a good first iteration; we want to land/test features rapidly so we can find precisely the kinds of follow-up bugs we have here.
Attachment #8693071 -
Flags: review?(bnicholson)
Updated•9 years ago
|
Assignee: nobody → johannesmarbach
Status: NEW → ASSIGNED
Assignee | ||
Updated•9 years ago
|
Attachment #8693071 -
Flags: review?(sarentz)
Attachment #8693071 -
Flags: review?(bnicholson)
Attachment #8693071 -
Flags: review-
Assignee | ||
Comment 10•9 years ago
|
||
Yes, that makes perfect sense. :)
I updated the pull request and the behavior should comply with Stefan's test case now. Brian, Stefan, I added both of you as reviewers because I wasn't sure whom to pick. I guess one reviewer will be enough but I'll let you guys work it out.
Comment 11•9 years ago
|
||
hennes, this works really well. fantastic.
Comment 12•9 years ago
|
||
Brian if you are happy with the code then we should land it and still ship it as part of 1.3!
Flags: needinfo?(bnicholson)
Updated•9 years ago
|
Whiteboard: [needsuplift]
Comment 13•9 years ago
|
||
Comment on attachment 8693071 [details] [review]
Pull request
Looks great, thanks! Left a few minor comments in the PR.
Flags: needinfo?(bnicholson)
Attachment #8693071 -
Flags: review?(bnicholson) → review+
Assignee | ||
Comment 14•9 years ago
|
||
Thanks for the feedback. I updated the PR with the small changes.
Comment 15•9 years ago
|
||
Thanks! Landed:
master: 531f59c
v1.x: d7255be
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [needsuplift]
Target Milestone: --- → 1.3
Updated•9 years ago
|
Status: RESOLVED → VERIFIED
Updated•9 years ago
|
Attachment #8693071 -
Flags: review?(sarentz)
You need to log in
before you can comment on or make changes to this bug.
Description
•