openvibers/openvibe.live Commits
No speculation rules on Live: a CSP report per page view, and prefetches nothing used (#604)
Changes
@@@ -86,6 +86,10 @@messages: { onOpen: () => { if (window.messengerWidget && window.messengerWidget.toggle) window.messengerWidget.toggle(); else location.href = 'https://openvibe.chat/messages'; }, href: 'https://openvibe.chat/messages' },// Same-origin links are routes of this single-page app.onNavigate: (href, e) => (typeof handleLinkClick === 'function' ? handleLinkClick(e, href) : true),++ // No speculation rules: the router answers same-site links, so a prefetched page was never used, and the++ // injected rules broke the hash-based report-only CSP on every page view (11-03: a /api/csp-report POST++ // each load; Chrome ignores 'inline-speculation-rules' beside hashes).++ speculate: false,onLogout: () => call('logout'),};}@@@ -27,4 +27,7 @@ assert.deepStrictEqual(sections, ["{ id: 'live', label: 'Live', items: ["], 'one});assert.ok(!/\bafter:/.test(menu), 'no rows after the network\'s');++// The router answers same-site links, so the navbar's speculation rules (which broke the report-only CSP) are off.++assert.match(src.slice(src.indexOf('function config(user)')), /speculate: false,/, 'no speculation rules on Live');++console.log('navbar menu live: all checks passed');
@@ -86,6 +86,10 @@
@@ -86,6 +86,10 @@
messages: { onOpen: () => { if (window.messengerWidget && window.messengerWidget.toggle) window.messengerWidget.toggle(); else location.href = 'https://openvibe.chat/messages'; }, href: 'https://openvibe.chat/messages' },
messages: { onOpen: () => { if (window.messengerWidget && window.messengerWidget.toggle) window.messengerWidget.toggle(); else location.href = 'https://openvibe.chat/messages'; }, href: 'https://openvibe.chat/messages' },
// Same-origin links are routes of this single-page app.
// Same-origin links are routes of this single-page app.
onNavigate: (href, e) => (typeof handleLinkClick === 'function' ? handleLinkClick(e, href) : true),
onNavigate: (href, e) => (typeof handleLinkClick === 'function' ? handleLinkClick(e, href) : true),
+ // No speculation rules: the router answers same-site links, so a prefetched page was never used, and the
+ // injected rules broke the hash-based report-only CSP on every page view (11-03: a /api/csp-report POST
+ // each load; Chrome ignores 'inline-speculation-rules' beside hashes).
+ speculate: false,
onLogout: () => call('logout'),
onLogout: () => call('logout'),
};
};
}
}
@@ -27,4 +27,7 @@ assert.deepStrictEqual(sections, ["{ id: 'live', label: 'Live', items: ["], 'one
@@ -27,4 +27,7 @@ assert.deepStrictEqual(sections, ["{ id: 'live', label: 'Live', items: ["], 'one
});
});
assert.ok(!/\bafter:/.test(menu), 'no rows after the network\'s');
assert.ok(!/\bafter:/.test(menu), 'no rows after the network\'s');
+// The router answers same-site links, so the navbar's speculation rules (which broke the report-only CSP) are off.
+assert.match(src.slice(src.indexOf('function config(user)')), /speculate: false,/, 'no speculation rules on Live');
+
console.log('navbar menu live: all checks passed');
console.log('navbar menu live: all checks passed');