X-Git-Url: https://git.yukkurigames.com/?p=pwl6.git;a=blobdiff_plain;f=src%2Fyuu%2Fcore.js;h=e770f863847fd857c6a8255b6fac3131b74b9257;hp=22a1fb436fad8caf320aadd651038ef44a6d394e;hb=2854030a3f699188676f19ba16a5400c4976f23c;hpb=8b63b6c5d0e8b87a19ff29a8fdc81b8db82907ee diff --git a/src/yuu/core.js b/src/yuu/core.js index 22a1fb4..e770f86 100644 --- a/src/yuu/core.js +++ b/src/yuu/core.js @@ -7,6 +7,10 @@ (function (yuu) { "use strict"; + yuu.isSafari = function (ua) { + return /^((?!chrome).)*safari/i.test(ua || navigator.userAgent) + || navigator.standalone; + }; yuu.require = function (m) { try { return require(m); } @@ -93,10 +97,12 @@ wkdoc.dispatchEvent(ev); }); win.on('new-win-policy', function (frame, url, policy) { - if (url.startsWith('chrome')) + if (url.startsWith('chrome')) { policy.forceNewPopup(); - else - policy.forceDownload(); + } else { + policy.ignore(); + gui.Shell.openExternal(url); + } }); } @@ -154,7 +160,7 @@ req[k] = params[k]; req.onload = function () { var status = this.status; - // status === 0 is given by node-webkit for success. + // status === 0 is given by NW.js for success. if ((status >= 200 && status < 300) || status === 0) resolve(this.response); else