Merge pull request #12258 from vector-im/t3chguy/csp
Embed CSP meta tag and stop using script-src unsafe-inline
This commit is contained in:
commit
eb62972aed
3 changed files with 26 additions and 11 deletions
|
@ -173,14 +173,17 @@ function onTokenLoginCompleted() {
|
|||
}
|
||||
|
||||
export async function loadApp() {
|
||||
if (window.vector_indexeddb_worker_script === undefined) {
|
||||
// XXX: the way we pass the path to the worker script from webpack via html in body's dataset is a hack
|
||||
// but alternatives seem to require changing the interface to passing Workers to js-sdk
|
||||
const vectorIndexeddbWorkerScript = document.body.dataset.vectorIndexeddbWorkerScript;
|
||||
if (!vectorIndexeddbWorkerScript) {
|
||||
// If this is missing, something has probably gone wrong with
|
||||
// the bundling. The js-sdk will just fall back to accessing
|
||||
// indexeddb directly with no worker script, but we want to
|
||||
// make sure the indexeddb script is present, so fail hard.
|
||||
throw new Error("Missing indexeddb worker script!");
|
||||
}
|
||||
MatrixClientPeg.setIndexedDbWorkerScript(window.vector_indexeddb_worker_script);
|
||||
MatrixClientPeg.setIndexedDbWorkerScript(vectorIndexeddbWorkerScript);
|
||||
CallHandler.setConferenceHandler(VectorConferenceHandler);
|
||||
|
||||
window.addEventListener('hashchange', onHashChange);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue