root.js 773 B

12345678910111213141516171819202122
  1. // Security, Encryption, and Authorization: SEA.js
  2. // MANDATORY READING: https://gun.eco/explainers/data/security.html
  3. // IT IS IMPLEMENTED IN A POLYFILL/SHIM APPROACH.
  4. // THIS IS AN EARLY ALPHA!
  5. if(typeof window !== "undefined"){ module.window = window }
  6. var tmp = module.window || module;
  7. var SEA = tmp.SEA || function(){};
  8. if(SEA.window = module.window){ try{
  9. SEA.window.SEA = SEA;
  10. tmp = document.createEvent('CustomEvent');
  11. tmp.initCustomEvent('extension', false, false, {type: "SEA"});
  12. (window.dispatchEvent || window.fireEvent)(tmp);
  13. window.postMessage({type: "SEA"}, '*');
  14. } catch(e){} }
  15. try{ if(typeof common !== "undefined"){ common.exports = SEA } }catch(e){}
  16. module.exports = SEA;