local overrides not applied after a reload until you open developer tools |
|||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36 Steps to reproduce the problem: 1. Create a local override for an html file (eg. change the font in an embedded style), verify that the modification is correct (e.g. the new font is used) 2. Close developer tools. The page still displays according to the local override. 3. Reload the page. It now displays the content without the local override. 4. Just open developer tools, that suffices to make the page be redrawn applying the local override. What is the expected behavior? I would expect one of the following: a) local overrides are always applied whether or not devtools is open (or has been opened). This would be a reasonable behavior if overrides are considered a way to apply persistent modification to some content, so they should be active irrespective of the presence of the debugging window. b) local overrides are only applied while devtools are open This would be a reasonable behavior if overrides are considered just a debugging tool so their effect should disappear once the debugging window is removed. What went wrong? As per the subject, after a reload overrides are not applied until the devtools has been opened. Did this work before? N/A Chrome version: 65.0.3325.162 Channel: stable OS Version: Flash Version:
,
Mar 22 2018
lrizzo@ - 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...!!
,
Mar 22 2018
It is a bit tricky to replicate the issue because it seems overrides are still subject
to cache control. Here is one way:
1. create a local file e.g. /tmp/a.html that points to an external cacheable css.
See an example at the bottom.
2. load /tmp/a.html from the browser
3. open devtools
4. go to the "Sources" tab, select the external css file, right-click and "Save for overrides"
5. in the right panel, edit the content of the local copy of the css.
An easy one for the css below is to add "background: red;" to the first line (body style).
It should have effect immediately in the rendered page.
6. now make sure the LocalOverride copy is saved, and here there is another bug:
there seems to be no explicit way to save the modified file in the LocalOverrides
directory, sometimes it happens after a while but not in a way that I could control
or understand.
What I found to work is the following:t
- right-click the file name in the right panel, "Save as..." and actually sav
the file somewhere. As a side effect, the content in the LocalOverrides
directory is also updated
7. now close the devtools panel. The change is still visible (red background)
8. reload /tmp/a.html from the browser. The page appears with the original white background.
9. open devtools. Now the change kicks in and the background turns red.
10. close devtools. Background remains red. goto step 8 if you like.
==== content of /tnp/a.html =============
<head>
<link rel="stylesheet" type="text/css" href="https://news.ycombinator.com/news.css">
</head>
this is the original linking to an external css
,
Mar 22 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 22 2018
,
Mar 22 2018
This behavior is by design. We don't want DevTools features to have effect in case DevTools are not opened.
,
Mar 22 2018
Understood, but then shouldn't the rendering be reverted to the original when DevTools is closed ?
,
Mar 22 2018
This can't be done without reloading of the page. Essentially, you're suggesting to revert the state of the program after the debugger is detached.
,
Mar 22 2018
Ok "revert" was the wrong term, "re-rendered using the original content" is maybe more appropriate. So are you saying that on DevTools close the page cannot be re-rendered with the original because the (in memory?) original version of the file is not available anymore having been overwritten by the LocalOverride version ? That would explain the behavior, but is a bit unfortunate because now the DevTools effect become persistent, contraddicting the (very reasonable) design goal in #6. Perhaps DevTools could save on the filesystem the current version of files that have a LocalOverride, so they could be reloaded on DevTools close ? |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by krajshree@chromium.org
, Mar 21 2018