mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 04:07:23 +00:00
Allow landing on fixed elements in obsidian
This commit is contained in:
8
dist/userscript/birb.user.js
vendored
8
dist/userscript/birb.user.js
vendored
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name Pocket Bird
|
||||
// @namespace https://idreesinc.com
|
||||
// @version 2025.11.13.47
|
||||
// @version 2025.11.13.64
|
||||
// @description It's a bird that hops around your web browser, the future is here
|
||||
// @author Idrees
|
||||
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
|
||||
@@ -1960,7 +1960,7 @@
|
||||
insertModal(`${birdBirb()} Mode`, message);
|
||||
}),
|
||||
new Separator(),
|
||||
new MenuItem("2025.11.13.47", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.47"); }, false),
|
||||
new MenuItem("2025.11.13.64", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.64"); }, false),
|
||||
];
|
||||
|
||||
const styleElement = document.createElement("style");
|
||||
@@ -2604,7 +2604,11 @@
|
||||
// @ts-expect-error
|
||||
const largeElements = Array.from(visible).filter((img) => img instanceof HTMLElement && img !== focusedElement && img.offsetWidth >= MIN_FOCUS_ELEMENT_WIDTH);
|
||||
// Ensure the bird doesn't land on fixed or sticky elements
|
||||
const fixedAllowed = getContext() instanceof ObsidianContext;
|
||||
const nonFixedElements = largeElements.filter((el) => {
|
||||
if (fixedAllowed) {
|
||||
return true;
|
||||
}
|
||||
const style = window.getComputedStyle(el);
|
||||
return style.position !== "fixed" && style.position !== "sticky";
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user