X-Git-Url: https://git.yukkurigames.com/?p=pwl6.git;a=blobdiff_plain;f=src%2Fyuu%2Fcore.js;h=22a1fb436fad8caf320aadd651038ef44a6d394e;hp=25d3ed2a52710ffb2da77e3445aaefae85420908;hb=8b63b6c5d0e8b87a19ff29a8fdc81b8db82907ee;hpb=0e309a67c4614ada4f075db7f730c0be41caa275 diff --git a/src/yuu/core.js b/src/yuu/core.js index 25d3ed2..22a1fb4 100644 --- a/src/yuu/core.js +++ b/src/yuu/core.js @@ -70,6 +70,9 @@ /** Initialize Yuu and call all registered hooks */ + document.body.className += (navigator.standalone || gui) + ? " standalone" : " browser"; + if (gui) { var win = gui.Window.get(); var nativeMenuBar = new gui.Menu({ type: "menubar" }); @@ -89,6 +92,12 @@ wkdoc.hidden = false; wkdoc.dispatchEvent(ev); }); + win.on('new-win-policy', function (frame, url, policy) { + if (url.startsWith('chrome')) + policy.forceNewPopup(); + else + policy.forceDownload(); + }); } return new Promise(function (resolve) {