← Commit history

verb battery: stage the set_file_input sample under Downloads; nb now refuses uploads from hidden home folders such as ~/.adom (pup-bridge#145)

Colby Knox ·fe04783401 ·5d ago ·parent fd8fcff
1 file changed +5−3
tools/verb-battery.mjs+5−3
@@ -222,10 +222,12 @@ const T = {   set_date: () => { const r = call('nbrowser_set_date', { sessionId: SID, selector: '#seg-m', date: '2026-08-14' }); settle(); const v = evalIn('document.getElementById("date-note").textContent'); return A(String(v.result) === '2026-08-14', 'segmented date typed (MDY keydowns)', `r:${JSON.stringify(r).slice(0,100)} note:${v.result}`); },   input_dispatch: () => { const r = call('nbrowser_input_dispatch', { sessionId: SID, type: 'click', selector: '#btn-one' }); return A(r.ok !== false, 'low-level dispatch ok', JSON.stringify(r).slice(0, 140)); },   set_file_input: () => {-    resolveNbDir();-    const up = call('send_files', { reason: 'verb battery: staging the sample upload file', filePaths: [join(root, 'demo', 'sample-upload.txt')], dest: NB_DIR });+    // Staged under the user's Downloads: nb refuses to hand a page anything from a hidden home folder such as+    // ~/.adom (pup-bridge#145), which is where NB_DIR lives.+    const upDir = resolveNbDir().replace(/\/\.adom\/native-browser$/i, '') + '/Downloads/nb-battery';+    const up = call('send_files', { reason: 'verb battery: staging the sample upload file', filePaths: [join(root, 'demo', 'sample-upload.txt')], dest: upDir });     if (up.success === false) return [false, 'send_files staging failed: ' + JSON.stringify(up).slice(0, 120)];-    call('nbrowser_set_file_input', { sessionId: SID, selector: '#file-input', filePaths: [NB_DIR + '/sample-upload.txt'] });+    call('nbrowser_set_file_input', { sessionId: SID, selector: '#file-input', filePaths: [upDir + '/sample-upload.txt'] });     const v = evalIn('document.getElementById("file-note").textContent');     return A(String(v.result).includes('sample-upload'), 'file attached to input', `note: ${v.result}`);   },