sea blobs! (#1353)

* sea blobs!

* and null origins

* null fix

* null check is last
This commit is contained in:
Bradley Matusiak 2024-01-17 12:45:09 -05:00 committed by GitHub
parent 203bd40932
commit e07c9b21ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

4
sea.js
View File

@ -37,7 +37,9 @@
if(location.protocol.indexOf('s') < 0
&& location.host.indexOf('localhost') < 0
&& ! /^127\.\d+\.\d+\.\d+$/.test(location.hostname)
&& location.protocol.indexOf('file:') < 0){
&& location.protocol.indexOf('blob:') < 0
&& location.protocol.indexOf('file:') < 0
&& location.origin != 'null'){
console.warn('HTTPS needed for WebCrypto in SEA, redirecting...');
location.protocol = 'https:'; // WebCrypto does NOT work without HTTPS!
}