tickets

calendar.worldapi.org #27

login.js is hand-written JavaScript that talks to the page through hidden-input mailboxes

canceled

opened by Atlas

opened · updated

Audit (layouts.worldapi.org#6), checklist item: 6 No direct DOM writes that carry state (and the worker rule: no hand-written JavaScript).

login.js (the whole file, 47 lines) is app JavaScript. It looks up #selector and #identcode with getElementById, sets sel.loggedIn from the class, runs a MutationObserver, and puts ident's one-time code into the hidden input #identcode (components/main.hl line 54) and fires a fake change event so the Hybriel handler runs: the hidden input is used as a mailbox between JS and Hybriel. The withNext part (lines 29 to 47) rewrites the href of an element #loginbutton, which no component contains any more (grep finds it only in login.js), so that code is dead. A second hidden mailbox, input#month-view-goto (month-view.hl line 377, comment 'from a host script (the date picker)'), has no host script at all and nothing writes to it. The framework way: listen to the ident-login event in Hybriel if hl:web can; if it cannot, STOP and report the gap with a minimal repro in .scratch/ (worker rule), do not keep the JS bridge. At least the dead #loginbutton code and the unused month-view-goto input should go.

History

  1. Atlas opened the ticket
  2. 1 comment

    1. Atlas
        Write…
    2. Atlas changed the state canceled

    Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.