DevTools: Audits warn about clearing localStorage
Reported by
dskl...@gmail.com,
Jan 27 2018
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Steps to reproduce the problem: 1. Use a webapp that uses localStorage. 2. Use Audit feature from devtools. 3. Notice that localStorage has been cleared. What is the expected behavior? Audits should not be destructive. What went wrong? localStorage was cleared. Did this work before? N/A Chrome version: 63.0.3239.132 Channel: stable OS Version: Ubuntu 14.04 LTS Flash Version:
,
Jan 29 2018
,
Jan 30 2018
dskloet@ - Thanks for filing the issue...!! Could you please provide a sample test file/url to test the issue from TE-end. This will help us in triaging the issue further. Thanks...!!
,
Jan 31 2018
Thanks for the report, can confirm on 64.0.3282.119 and 66.0.3336.0.
,
Jan 31 2018
Note that this is intentional to provide a clean slate when loading the page and is necessary to validate the aspects of PWA from a new user's perspective. I'll convert this to a tracking issue to provide a clearer warning of this.
,
Feb 1 2018
Why do you need to destroy the user profile for this? If you need clean state, why not use an incognito-like sandbox?
,
Feb 1 2018
@dskloet there's some discussion in https://github.com/GoogleChrome/lighthouse/issues/2599 and https://github.com/GoogleChrome/lighthouse/issues/1418 that may interest you, feel free to add your use cases there. The tl;dr is being able to still test the current logged in page you're on (we don't clear cookies for this reason).
,
Feb 2 2018
I don't understand why cookies and localStorage should be treated differently. Of course you want to audit the page in the current state. Why destroy one kind of state and not another kind of state? Can you just make it clear that the page is audited in the current state so the developer can use incognito or another profile if they want to audit the page in a different state? Then you don't need to destroy any state.
,
Feb 2 2018
> Of course you want to audit the page in the current state. While a use case we're considering, this isn't actually the current goal. Current page state is always wiped away by reloading, and a large chunk of audits are explicitly targeting cold page load. An exception was made for cookies because auth is typically stored there, and it enables audits on pages that are behind a login. Local storage is a rarer location for auth tokens, so the exception was not made for that. If you take issue with this policy, please file an issue on GitHub (https://github.com/GoogleChrome/lighthouse/issues/new) where it can be weighed in on by other Lighthouse contributors.
,
Feb 2 2018
> Current page state is always wiped away by reloading But it's not. Some state (localStorage) is wiped, but other state (cookies) is not. The page load is certainly not cold. Regardless, if someone wants the page load to be cold, they can easily wipe their own data. But if they don't want the data to be wiped, they currently have no choice. So it seems strictly better not to wipe anything automatically. I don't know what is Lighthouse. Is bugs.chromium.org no longer the right place to file Chrome bugs?
,
Feb 3 2018
Yes, bugs.chromium.org is still the place to file Chrome bugs. However, Lighthouse is a library that gets pulled in to DevTools as the audits panel. Because development and the community exist over on GitHub, we try to have most discussions on substantive issues affecting the entire library over on that repository instead :)
,
Oct 31
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by susanjun...@techmahindra.com
, Jan 29 2018