www.capital.gr - The site refresh indefinitely
Categories
(Web Compatibility :: Site Reports, defect, P2)
Tracking
(Webcompat Priority:P2, firefox134 affected, firefox135 affected, firefox136 affected)
Webcompat Priority | P2 |
People
(Reporter: ctanase, Assigned: twisniewski)
References
()
Details
(Keywords: webcompat:needs-contact, webcompat:site-report, webcompat:sitepatch-applied, Whiteboard: [webcompat-source:web-bugs])
User Story
platform:android impact:workflow-broken configuration:general affects:all branch:release diagnosis-team:webcompat user-impact-score:600
Attachments
(3 files)
Environment:
Operating system: Android 10
Firefox version: Firefox Mobile 90.0/134/136
Steps to reproduce:
- Go to https://www.capital.gr/
- Refresh the page.
- Observe the behavior.
Expected Behavior:
The page reloads correctly.
Actual Behavior:
The page reloads indefinitely.
Notes:
- Reproduces regardless of the status of ETP
- Reproduces in firefox-nightly, and firefox-release
- Does not reproduce in chrome
Created from https://github.com/webcompat/web-bugs/issues/74073
Reporter | ||
Updated•27 days ago
|
Reporter | ||
Updated•27 days ago
|
Comment 1•27 days ago
|
||
Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.
Updated•27 days ago
|
Updated•27 days ago
|
Comment 2•23 days ago
•
|
||
I can reproduce on desktop in Responsive Design Mode, with a 300x600 viewport and this user agent string taken from my phone:
Mozilla/5.0 (Android 15; Mobile; rv:136.0) Gecko/136.0 Firefox/136.0
I wasn't able to reproduce when I used a 400x600 viewport [EDIT: I can repro with this window size after all; it just needs a manual reload in order to trigger the issue, and I'd overlooked that part.]
Here's a profile (with networking logging enabled in case it's handy, and with 0.1ms-frequency samples), showing several of the reloads:
https://share.firefox.dev/4jGbVA3
The marker-chart shows some CreateAboutBlankDocumentViewer
marks right around each reload point. I haven't yet dug backwards to see what's causing the reload.
Comment 3•22 days ago
|
||
The site here does something pretty pathological -- reloading immediately as soon as we load the page, basically -- and it seems that Chrome has a mitigation for that sort of pattern and we don't (or our intervention isn't effective in this case).
Comment 4•22 days ago
•
|
||
Actually maybe this isn't so much a mitigation as just a difference in how form field state is preserved across reloads.
The site here does this pathological thing:
<input id="alwaysFetch" type="hidden" />
<script>
setTimeout(function () {
var el = document.getElementById('alwaysFetch');
el.value = el.value ? location.reload() : true;
}, 0);
</script>
The first time you load the page, the alwaysFetch
element is empty, which means el.value
is falsey, so this assignment...
el.value = el.value ? location.reload() : true;
...essentially just evaluates to:
el.value = true;
The next time you load the page, we preserve the form state, which means when we hit that setTimeout, el.value
is now truthy (it's probably the string "true" or whatever el.value = true
coerces to). So the assignment now evaluates to:
el.value = location.reload();
...which reloads (and also stores the string undefined
in the input element). The next load does the same thing, etc. forever.
In Chrome, I think el.value
doesn't get preserved to the next page load in this case for some reason, so they never trigger the location.reload()
.
Comment 5•22 days ago
|
||
Comment 6•22 days ago
|
||
Maybe Chrome doesn't preserve form state across reloads at all, actually?
Here's an interactive testcase to illustrate this.
STR here:
- Load the testcase
- Type "abc" into the textfield
- Ctrl+R
Firefox behavior: The textfield still shows "abc" after the reload.
Chrome behavior: The textfield is blank after the reload.
Firefox's behavior here is meant to be helpful, but this particular site happens to be depending on the Chrome behavior (and they reload-forever in a browser with the form-field-preserving Firefox behavior, via the pathological setTimeout-based mechanism described above).
Comment 7•22 days ago
•
|
||
I suspect we're not going to turn off our helpful form-field-restoration behavior here just on account of this site, so our only option might be an intervention (or maybe outreach if we can get in touch with the site).
Our intervention would be some JS snippet like the following, to clear the value on this hidden form field:
var el = document.getElementById('alwaysFetch');
el.value = '';
The tricky bit might be to get this script to run after <input id="alwaysFetch">
gets parsed but before the subsequent inline <script> element's setTimeout fires. I'm pretty sure that setTimeout can fire before the "load" event fires, for example.
I suppose another mitigation would be to change our form-field-restoration behavior to be something that we can toggle on/off on a per-domain basis for compat reasons, and we could force it to off for this site.
Updated•22 days ago
|
Comment 8•22 days ago
•
|
||
A few references:
- There's some analysis/description of this behavior across browsers here.
- It seems we have bug 46845 filed on the interop difference here, which is resolved as invalid because presumably we're not planning to change, but it appears we're also using it to track sites that appear broken in Firefox due to this behavior.
Comment 9•22 days ago
|
||
Ah, it looks like ksenia already diagnosed this in https://github.com/webcompat/web-bugs/issues/74073#issuecomment-860833691
Calin: when moving issues from github to bugzilla: if you happen to notice that some diagnosis has already been done on the GitHub issue, it'd be great to call that out in the Bugzilla bug-report, so that we don't duplicate diagnosis work. Thanks!
Assignee | ||
Updated•11 days ago
|
Assignee | ||
Comment 10•11 days ago
|
||
Updated•11 days ago
|
Comment 11•11 days ago
|
||
Comment 12•10 days ago
|
||
bugherder |
Assignee | ||
Updated•10 days ago
|
Description
•