OpenWindow.jslib 416 B

123456789101112131415161718192021
  1. /*
  2. * Based on:
  3. * https://github.com/valyard/UnityWebGLOpenLink
  4. */
  5. var OpenWindowPlugin = {
  6. openWindow: function(link)
  7. {
  8. var url = Pointer_stringify(link);
  9. var func = function()
  10. {
  11. window.open(url);
  12. document.removeEventListener('mouseup', func);
  13. }
  14. document.addEventListener('mouseup', func);
  15. }
  16. };
  17. mergeInto(LibraryManager.library, OpenWindowPlugin);