Live-read all DOM attributes: forms and preloads too
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m49s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m49s
bindBoostForm re-reads method/action at submit time. bind-preload-for re-reads verb-info and headers at preload time. No closed-over stale values anywhere in the event binding system. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2731,11 +2731,14 @@ PLATFORM_ORCHESTRATION_JS = """
|
||||
});
|
||||
}
|
||||
|
||||
function bindBoostForm(form, method, action) {
|
||||
function bindBoostForm(form, _method, _action) {
|
||||
form.addEventListener("submit", function(e) {
|
||||
e.preventDefault();
|
||||
executeRequest(form, { method: method, url: action }).then(function() {
|
||||
try { history.pushState({ sxUrl: action, scrollY: window.scrollY }, "", action); } catch (err) {}
|
||||
// Re-read from element at submit time
|
||||
var liveMethod = (form.getAttribute("method") || _method || "GET").toUpperCase();
|
||||
var liveAction = form.getAttribute("action") || _action || location.href;
|
||||
executeRequest(form, { method: liveMethod, url: liveAction }).then(function() {
|
||||
try { history.pushState({ sxUrl: liveAction, scrollY: window.scrollY }, "", liveAction); } catch (err) {}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user