When I use responsive design regime and want to view source - Ctrl+U - I will see source code of desktop version
Categories
(DevTools :: Responsive Design Mode, defect, P3)
Tracking
(Not tracked)
People
(Reporter: standa.david, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
Steps to reproduce:
I pressed F12 to developer tools, then enabled Responsive regime - in my case iphone 6/7/8 and then pressed Ctrl+U
Actual results:
Source code of desktop version
Expected results:
Source code of mobile version
Comment 1•6 years ago
|
||
Hi David,
Could you please provide the site you are experiencing this issue with?
Reporter | ||
Comment 2•6 years ago
|
||
https://www.journal-theme.com/1/
body has classes which are different for mobile and desktop version
Updated•6 years ago
|
Comment 3•6 years ago
|
||
Would you please provide a reduced testcase with clear expected results? It's difficult to know what the source is supposed to look like with your example provided in comment 2.
Updated•6 years ago
|
Comment 4•6 years ago
|
||
This sounds like a User Agent string detection issue. We can try to build our own test case based on that assumption.
Comment 5•6 years ago
|
||
I'm able to reproduce this bug.
STR:
- visit https://www.journal-theme.com/1/
- press ctrl+u/cmd+u to view the source =>
html
element has desktop specific classes, like.desktop
- go back to the page
- enter RDM, select a touch device (and to be safe, reload the page)
- press ctrl+u/cmd+u again
AR:
- view source shows desktop source again
ER:
- view source should show mobile source, similar to what the markup view in the inspector does. When you observe the classes on the
html
element, you should see for example.phone
and.touchevents
You are setting the class ".mobile" viaJavascript.
"View source" never shows Javascript code changes, except when using "View Selection source" in the context menu
Updated•5 years ago
|
Comment 7•3 years ago
|
||
I just tested the steps from comment 5 in Firefox 103.0.2 and cannot reproduce this issue. I.e. I saw the mobile version of the page and the <html>
element also had mobile
, phone
and touchevents
as classes when I selected "iPhone 12/13 Pro Max" as device.
David, can you confirm that this is now working as expected?
Sebastian
Comment 8•3 years ago
|
||
Redirect a needinfo that is pending on an inactive user to the triage owner.
:nchevobbe, since the bug has recent activity, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 9•3 years ago
|
||
This is not related to RDM: the on https://www.journal-theme.com/1/ , the desktop
class is part of the source. Resizing the main Firefox window (or turning RDM), might remove it as there's a MediaQueryList listener. The latter change is reflected in DevTools inspector , but not in the view-source code, which simply displays the document as its sent through the network
I also just checked Chrome, and it has a similar behavior (I wasn't able to test while RDM is open as there don't seem to have a way to access view source from there?)
Description
•