Project

General

Profile

Actions

Feature #767

closed

Is there any way to force desktop view?

Added by Neon Robot 9 months ago. Updated 9 months ago.

Status:
Closed
Priority:
3.x
Start date:
10/04/2021
Due date:
% Done:

0%

Estimated time:

Description

...page and changing user agent don't do anything. If page opened as mobile version, it can't be switched to desktop one. For example in Firefox such feature works.

Or i am missing something?


Files

Responsive Design.png (925 KB) Responsive Design.png Soren Stoutner, 10/05/2021 01:50 PM
Actions #1

Updated by Soren Stoutner 9 months ago

  • Assignee set to Soren Stoutner

The answer to that question depends entirely on how the website determines when to send a desktop view. For example, a few websites use the width of your screen to determine if they should send a desktop view. Firefox has the ability to lie to the website about the width of the screen and does so in their Desktop Mode. Android's WebView does not provide that functionality (although that is a planned feature for Privacy WebView).

What is an example of a website where Firefox can display a desktop view and Privacy Browser cannot?

Actions #2

Updated by Neon Robot 9 months ago

Neon Robot wrote:

...page and changing user agent don't do anything. If page opened as mobile version, it can't be switched to desktop one. For example in Firefox such feature works.

Or i am missing something?

For eg. this site:
https://trackerninja.codeberg.page/

Actions #3

Updated by Soren Stoutner 9 months ago

I think it is important to distinguish between two related ideas that are sometimes conflated.

1 - Some websites have two different versions of the website, one that they send to desktop browsers and another that they send to mobile browsers. When you make a request to the webserver, it analyzes the request and makes a determination as to which version of the website it will send in response. Based on whatever criteria the webserver uses to decide, you will receive different HTML, CSS, and JavaScript responses. This is known as adaptive web design:

https://en.wikipedia.org/wiki/Adaptive_web_design

Wikipedia is an example of a website that does this. In this case, the purpose of a desktop mode is to convince the webserver to send different HTML, CSS, and JavaScript files to the browser.

2 - Other websites send the same HTML, CSS, and JavaScript to all browsers. The are built using adaptive design, where the HTML, CSS, and JavaScript adjust the layout in a way where it makes sense on any screen size. This is known as responsive web design.

https://en.wikipedia.org/wiki/Responsive_web_design

trackerninja.codeberg.page is an example of this. In this case, the purpose of a desktop mode is to convince the HTML renderer to layout the HDML, CSS, and JavaScript files differently. It often does this by lying about the true width of the screen to make it layout more like the desktop.

As mentioned above, Android's WebView does not currently provide a way to lie about the width of the screen. But, it is a planned feature for Privacy WebView.

https://redmine.stoutner.com/issues/233

You can verify that trackerninja.codeberg.page is using responsive web design and that it lays out the same as it does in Firefox in "Desktop Mode" by viewing it in Privacy Browser on a device with a larger screen (see attached screenshot).

Actions #4

Updated by Neon Robot 9 months ago

Soren Stoutner wrote:

I think it is important to distinguish between two related ideas that are sometimes conflated.
You can verify that trackerninja.codeberg.page is using responsive web design and that it lays out the same as it does in Firefox in "Desktop Mode" by viewing it in Privacy Browser on a device with a larger screen (see attached screenshot).

Thank you for such a detailed answer!
And anyways, it will be neat to see such feature in a future version of Privacy Browser.

Actions

Also available in: Atom PDF