mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00

later with @bmatusiak check sea.then for '../gun.js' vs '../' vs ... note: src/index -> core.js TODO: something about WebRTC candidates hitting ack decrement limits?
16 lines
545 B
JavaScript
16 lines
545 B
JavaScript
;(function(){
|
|
|
|
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('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!
|
|
}
|
|
} }catch(e){}
|
|
|
|
}()); |