diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index c38dfe6e..f5b16dc4 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -418,6 +418,7 @@ a, #files tbody div a:last-child { padding: .3em .6em; border-radius: .3em; border-width: .15em 0; + white-space: nowrap; } .opbox { background: #2d2d2d; diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index e2f9b346..d17cd99a 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -18,10 +18,10 @@ function goto_up2k() { // usually it's undefined but some chromes throw on invoke var up2k = null; try { - crypto.subtle.digest( - 'SHA-512', new Uint8Array(1) - ).then( - function (x) { up2k = up2k_init(true) }, + var cf = window.crypto || window.msCrypto; + cf = cf.subtle || cf.webkitSubtle; + cf.digest('SHA-512', new Uint8Array(1)).then( + function (x) { up2k = up2k_init(cf) }, function (x) { up2k = up2k_init(false) } ); } @@ -401,9 +401,7 @@ function U2pvis(act, btns) { } -function up2k_init(have_crypto) { - //have_crypto = false; - +function up2k_init(subtle) { // show modal message function showmodal(msg) { ebi('u2notbtn').innerHTML = msg; @@ -431,7 +429,7 @@ function up2k_init(have_crypto) { // upload ui hidden by default, clicking the header shows it function init_deps() { - if (!have_crypto && !window.asmCrypto) { + if (!subtle && !window.asmCrypto) { showmodal('

loading sha512.js

since ' + shame + '

thanks chrome

'); import_js('/.cpr/deps/sha512.js', unmodal); @@ -986,8 +984,8 @@ function up2k_init(have_crypto) { st.todo.handshake.push(t); }; - if (have_crypto) - crypto.subtle.digest('SHA-512', buf).then(hash_done); + if (subtle) + subtle.digest('SHA-512', buf).then(hash_done); else { var hasher = new asmCrypto.Sha512(); hasher.process(new Uint8Array(buf)); diff --git a/copyparty/web/upload.css b/copyparty/web/upload.css index d7c3d6d8..074115fb 100644 --- a/copyparty/web/upload.css +++ b/copyparty/web/upload.css @@ -97,6 +97,7 @@ #u2cards { padding: 1em 0 .3em 1em; margin: 1.5em auto -2.5em auto; + white-space: nowrap; text-align: center; overflow: hidden; }