mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
12 lines
442 B
JavaScript
12 lines
442 B
JavaScript
|
|
var SEA = require('./root');
|
|
try{ if(SEA.window){
|
|
if(location.protocol.indexOf('s') < 0
|
|
&& location.host.indexOf('localhost') < 0
|
|
&& ! /^127\.\d+\.\d+\.\d+$/.test(location.hostname)
|
|
&& location.protocol.indexOf('file:') < 0){
|
|
console.warn('HTTPS needed for WebCrypto in SEA, redirecting...');
|
|
location.protocol = 'https:'; // WebCrypto does NOT work without HTTPS!
|
|
}
|
|
} }catch(e){}
|
|
|