iojs adds Math.sign, still lacks Object.assign.
[pwl6.git] / src / yuu / core.js
index 22a1fb4..d34d201 100644 (file)
@@ -7,13 +7,12 @@
 (function (yuu) {
     "use strict";
 
-
     yuu.require = function (m) {
         try { return require(m); }
         catch (exc) { return null; }
     };
 
-    if (!Math.sign)
+    if (!Object.assign)
         require("./pre");
 
     var yT = this.yT || require("./yT");
                 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);
+                }
             });
         }
 
                 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