Skip to content

fix(webserver): make footer's "Download link" refresh the main page - #81

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/footer-refresh
Jun 11, 2026
Merged

fix(webserver): make footer's "Download link" refresh the main page#81
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/footer-refresh

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

refreshFrames() was broken in two ways: it assigned a new URL to 'location' and immediately called location.reload(), so the reload cancelled/duplicated the navigation; and since footer.php runs inside an iframe, 'location' only ever pointed at the iframe itself, never the main page. On top of that it ran from the submit button's onClick, i.e. before the form was actually submitted, racing the POST that adds the ed2k link.

Fix by navigating the top window once via window.top.location, and only after the form round-trip: the onClick handler and the refreshFrames() function are removed, and footer.php now emits a one-line script in its response only when the Submit parameter is present, i.e. after the server has already processed the ed2k link. The main page then reloads on amuleweb-main-dload.php and shows the new download.

refreshFrames() was broken in two ways: it assigned a new URL to
'location' and immediately called location.reload(), so the reload
cancelled/duplicated the navigation; and since footer.php runs inside
an iframe, 'location' only ever pointed at the iframe itself, never
the main page. On top of that it ran from the submit button's onClick,
i.e. before the form was actually submitted, racing the POST that adds
the ed2k link.

Fix by navigating the top window once via window.top.location, and
only after the form round-trip: the onClick handler and the
refreshFrames() function are removed, and footer.php now emits a
one-line script in its response only when the Submit parameter is
present, i.e. after the server has already processed the ed2k link.
The main page then reloads on amuleweb-main-dload.php and shows the
new download.

Item 6 (P1) of .claude/WEBUI_MODERNIZATION.md.
@ngosang
ngosang merged commit 69cfdec into amule-org:master Jun 11, 2026
9 checks passed
@ngosang
ngosang deleted the fix/footer-refresh branch June 11, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant