ThinBridge / Chronos

Chromiumベースの業務ブラウザ
Other
5 stars 3 forks source link

Window: limit the maximum size of popup windows #154

Closed HashidaTKS closed 8 months ago

HashidaTKS commented 8 months ago

Which issue(s) this PR fixes:

What this PR does / why we need it:

ポップアップウィンドウの表示時、指定されたポップアップウィンドウのサイズが大きいと、(タスクバーを除いた)スクリーンサイズよりも大きなサイズで表示されてしまう。

サンプル:

popup.zip

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
    function openPopup() {
      window.open(
        "https://www.google.co.jp/",
        "popup",
        `left=0, top=0, width=${screen.availWidth}, height=${screen.availHeight}`);
      }
</script>
</head>
<body>
    <button onclick="openPopup()">open popup</button>
</body>
</html>

上記のサンプルHTML(popup.html)を保存し、open popupボタンをクリックするとGoogleが開く。 サンプルではscreen.availHeightとスクリーンの高さ自体を指定しているが、スクリーンサイズよりも大きなポップアップウィンドウが表示され、Google画面の下部がタスクバーに被って見切れてしまう。

image

How to verify the fixed issue:

The steps to verify:

Expected result: