diff --git a/dist/birb.js b/dist/birb.js index 34daeb6..3192d72 100644 --- a/dist/birb.js +++ b/dist/birb.js @@ -1946,7 +1946,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"); @@ -2590,7 +2590,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"; }); diff --git a/dist/extension.zip b/dist/extension.zip index 6ba092e..2985380 100644 Binary files a/dist/extension.zip and b/dist/extension.zip differ diff --git a/dist/extension/birb.js b/dist/extension/birb.js index 34daeb6..3192d72 100644 --- a/dist/extension/birb.js +++ b/dist/extension/birb.js @@ -1946,7 +1946,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"); @@ -2590,7 +2590,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"; }); diff --git a/dist/extension/manifest.json b/dist/extension/manifest.json index 8cc1fa7..1043051 100644 --- a/dist/extension/manifest.json +++ b/dist/extension/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "Pocket Bird", "description": "It's a pet bird in your browser, what more could you want?", - "version": "2025.11.13.47", + "version": "2025.11.13.64", "homepage_url": "https://idreesinc.com", "icons": { "48": "images/icons/transparent/48x48x1.png", diff --git a/dist/obsidian/main.js b/dist/obsidian/main.js index 45f7460..398dcba 100644 --- a/dist/obsidian/main.js +++ b/dist/obsidian/main.js @@ -2,7 +2,7 @@ const { Plugin, Notice } = require('obsidian'); module.exports = class PocketBird extends Plugin { onload() { - console.log("Loading Pocket Bird version 2025.11.13.47..."); + console.log("Loading Pocket Bird version 2025.11.13.64..."); const OBSIDIAN_PLUGIN = this; (function () { 'use strict'; @@ -1952,7 +1952,7 @@ module.exports = class PocketBird extends Plugin { 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"); @@ -2596,7 +2596,11 @@ module.exports = class PocketBird extends Plugin { // @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"; }); diff --git a/dist/obsidian/manifest.json b/dist/obsidian/manifest.json index 326e8b8..6b45b09 100644 --- a/dist/obsidian/manifest.json +++ b/dist/obsidian/manifest.json @@ -1,7 +1,7 @@ { "id": "pocket-bird", "name": "Pocket Bird", - "version": "2025.11.13.47", + "version": "2025.11.13.64", "minAppVersion": "0.15.0", "description": "It's a pet bird in your Obsidian, what more could you want?", "author": "Idrees Hassan", diff --git a/dist/userscript/birb.user.js b/dist/userscript/birb.user.js index 791deb7..e2b828e 100644 --- a/dist/userscript/birb.user.js +++ b/dist/userscript/birb.user.js @@ -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"; }); diff --git a/src/application.js b/src/application.js index 8489f65..acb1a7b 100644 --- a/src/application.js +++ b/src/application.js @@ -2,7 +2,7 @@ import Frame from './frame.js'; import Layer from './layer.js'; import Anim from './anim.js'; import { Birb, Animations } from './birb.js'; -import { getContext } from './context.js'; +import { getContext, ObsidianContext } from './context.js'; import { Directions, @@ -880,7 +880,11 @@ Promise.all([ // @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"; }); diff --git a/src/context.js b/src/context.js index 0e875a4..f693f05 100644 --- a/src/context.js +++ b/src/context.js @@ -222,7 +222,7 @@ class BrowserExtensionContext extends Context { } } -class ObsidianContext extends Context { +export class ObsidianContext extends Context { /** * @override