Skip to content

知らない分野を、原文にたどりつくまで芋づる式に掘る Claude Code のスキル

Python

dashboard: PC で入れたアプリの窓(minimal-ui)では入れる案内を出さない

MaryCache2a17a3ebff83
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 95d7435..ce5a65f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,10 @@ mainにコミットが入るたびに、使っている人へ更新が届きま
## [未公開]
+### 修正
+
+- PCのEdgeなどでアプリとして入れた窓の中に、アプリとして入れる案内(右上のボタンと帯)が出続けていたのを直しました。manifestが無いうちに入れた窓はminimal-uiの表示で開くため、standaloneだけを見ていた判定ではアプリの窓と分かりませんでした。
+
## [2.0.0] - 2026-10-25
1.0のimozuruは原文を集め、抜き書きとして見せるところまでを受け持っていました。
diff --git a/skills/imozuru/scripts/dashboard.py b/skills/imozuru/scripts/dashboard.py
index 298ced1..0bab16a 100644
--- a/skills/imozuru/scripts/dashboard.py
+++ b/skills/imozuru/scripts/dashboard.py
@@ -1535,8 +1535,12 @@ d.querySelectorAll('[data-close]').forEach(function(x){x.addEventListener('click
var ib=document.getElementById('inst'),bar=document.getElementById('inst-bar'),idl=document.getElementById('inst-dlg'),K='imozuru-install',ev=null,
web=/^https?:$/.test(location.protocol),ua=navigator.userAgent,ios=/iPhone|iPad|iPod/.test(ua)||(/Macintosh/.test(ua)&&navigator.maxTouchPoints>1),
plat=ios?'ios':/Android/.test(ua)?'android':/Firefox\//.test(ua)?'firefox':(/Safari\//.test(ua)&&!/Chrome\/|Chromium|Edg\//.test(ua))?'safari':'chromium';
+// アプリの窓は body.app(standalone)に加えて minimal-ui も見る。manifest が無いうちに Edge の「このサイトをアプリとしてインストール」で入れた窓は
+// minimal-ui で開き、standalone だけを見ると窓の中に入れる案内が残った(2026-10-25・Edge の記録の effective_display_mode が 2)。
+// body.app はホーム画面の見た目にも使うので広げない。fullscreen は F11 の全画面のタブにも当たりうるので入れない
+var inapp=b.classList.contains('app')||matchMedia('(display-mode: minimal-ui)').matches;
function gone(){ib.hidden=true;bar.hidden=true}
-if(!web||b.classList.contains('app'))gone();
+if(!web||inapp)gone();
else{ib.hidden=false;idl.querySelectorAll('[data-plat]').forEach(function(p){p.hidden=p.getAttribute('data-plat')!==plat});
var seen=null;try{seen=localStorage.getItem(K)}catch(x){}
if(!seen)setTimeout(function(){bar.hidden=false;rise(bar,false)},1200)}
diff --git a/tests/test_app_features.py b/tests/test_app_features.py
index 139e6be..be4e34b 100644
--- a/tests/test_app_features.py
+++ b/tests/test_app_features.py
@@ -91,6 +91,10 @@ class AppFeatureTests(unittest.TestCase):
# 入れるボタンは書き出しておき、窓口で開いたときだけスクリプトが出す
self.assertIn('id="inst" type="button" hidden', static)
+ def test_install_prompt_is_hidden_in_minimal_ui_windows(self):
+ # manifest が無いうちに PC のブラウザで入れた窓は minimal-ui で開く。standalone だけを見ると窓の中に案内が残る
+ self.assertIn("matchMedia('(display-mode: minimal-ui)')", self.page(served=True))
+
def test_page_html_never_contains_the_token(self):
code, _, body = self.request(f"/?k={TOKEN}")
self.assertEqual(code, 200)