fix(mobile): Ask-MSOS pill yields to cookie/language banners
Deploy to Production on Develop Push / deploy (push) Successful in 19s
Deploy to Production on Develop Push / deploy (push) Successful in 19s
In in-app browsers (Instagram/Facebook) the floating pill (z-index 9999, same as the cookie banner) sat on top of the cookie Accept button and the language banner, so consent could not be tapped. The pill now hides whenever the cookie-consent (.msos-cc) or language (.lang-suggest) banner is present, via a MutationObserver on <body>, and reappears once they are dismissed. With the pill yielding, the language banner is dropped back to the bottom edge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
6bfd882354
commit
7c2110d8a5
3 files changed
+18
-3
No files matched your search
@@ -321,6 +321,19 @@
|
||||
root.querySelector(".msa-x").addEventListener("click", close);
|
||||
root.querySelector(".msa-form").addEventListener("submit", function (e) { e.preventDefault(); submit(); });
|
||||
document.addEventListener("keydown", function (e) { if (e.key === "Escape" && opened) close(); });
|
||||
|
||||
// Yield to bottom-anchored overlays (cookie-consent banner, language
|
||||
// banner) so the launcher never sits on top of their action buttons —
|
||||
// important in in-app browsers (Instagram/Facebook) where everything
|
||||
// stacks at the bottom. The pill reappears once they are dismissed.
|
||||
(function () {
|
||||
function overlayUp() {
|
||||
return !!document.querySelector(".msos-cc") || !!document.querySelector(".lang-suggest");
|
||||
}
|
||||
function sync() { root.classList.toggle("msa-hidden", overlayUp()); }
|
||||
try { new MutationObserver(sync).observe(document.body, { childList: true }); } catch (e) {}
|
||||
sync();
|
||||
})();
|
||||
}
|
||||
|
||||
if (document.readyState !== "loading") build();
|
||||
|
||||
Reference in new issue
Block a user