! Title: Intentional: Bluesky (AdGuard) ! Description: Removes Bluesky's algorithmic feeds and infinite scrolling, so you only see what you came for. ! Homepage: https://aymericbeaumet.github.io/intentional/ ! License: MIT ! Version: 0.2.0 ! Expires: 1 day ! Redirects need this list to be added as Trusted ! ===== Bluesky ===== ! Bluesky: see site.yaml for the policy and tests.yaml for what each rule must do. ! --- Discover feed on the home screen --- ! Bluesky marks the Discover feed page with data-nosnippet, in every language. bsky.app##[data-testid="customFeedPage"][data-nosnippet] ! Tab labels are localized: this one only matches the English UI. bsky.app##[role="tab"]:has([data-testid="homeScreenFeedTabs-Discover"]) ! Discover in the desktop sidebar's list of pinned feeds. bsky.app##[role="link"][aria-label="Discover"] ! The Discover feed opened by URL (redirected when redirects are on). [$path=/^\\/profile\\/(bsky\\.app|did:plc:z72i7hdynmk6r22z27h6tvur)\\/feed\\/whats-hot\\/?(\\?|$)/]bsky.app##[data-testid="customFeedScreen"] ! --- Trending topics (sidebar and Explore) --- ! Every trending topic links to a feed of the trending.bsky.app account. bsky.app##div:has(> div > a[href^="/profile/did:plc:qrz3lhbyuxbeilrc6nekdqme/feed/"]) [$path=/^\\/profile\\/(trending\\.bsky\\.app|did:plc:qrz3lhbyuxbeilrc6nekdqme)\\/feed\\//]bsky.app##[data-testid="customFeedScreen"] ! --- Explore: what Search shows before you type a query --- [$path=/^\\/search\\/?$/]bsky.app##[data-testid="searchScreen"] > div:nth-child(2) > div:first-child ! --- Suggested accounts injected into timelines --- bsky.app##div:has(> div > div > [aria-label="See more suggested profiles"]) ! Bluesky: redirects to the intentional view bsky.app#%#(function(){function g(a,t){for(const f of t){const p=new RegExp(f.from).exec(a);if(!p)continue;const i=f.to.replace(/\$(\d)/g,(h,s)=>p[Number(s)]??"");return i===a?null:i}return null}function v(a,t){const f=a&&new RegExp(a.path),p=e=>{const n=t.document;if(f?.test(t.location.pathname)){const u=a?.viewer;if(!u||u==="*")return n.body;const l=e.closest(u)||Array.from(n.querySelectorAll(u)).find(E=>E.getClientRects().length>0);if(l)return l}if(n.fullscreenElement?.querySelector("video"))return n.fullscreenElement;let o=!1,c=e===n.body||e===n.documentElement?n.elementFromPoint(t.innerWidth/2,t.innerHeight/2):e;for(;c;c=c.parentElement){const u=t.getComputedStyle(c);if(o&&/^(y|block) (mandatory|proximity)$/.test(u.scrollSnapType)&&c.scrollHeight>c.clientHeight)return c;!o&&u.scrollSnapAlign!=="none"&&(c.matches("video")||c.querySelector("video"))&&(o=!0)}return null},i={capture:!0,passive:!1},h=e=>{const n=e.target,o=n instanceof t.Element?n:t.document.body;if(!o)return;const c=p(o),u=c?.querySelector("video")??(c&&c!==t.document.body?c.querySelector("img"):null);if(!c||!u||o.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="slider"]'))return;let l=o;for(;l&&l!==t.document.body;l=l.parentElement)if(l.scrollHeight>l.clientHeight&&/^(auto|scroll)$/.test(t.getComputedStyle(l).overflowY)&&!l.contains(u)){l instanceof t.HTMLElement&&t.getComputedStyle(l).overscrollBehaviorY==="auto"&&(l.style.overscrollBehaviorY="contain"),e.stopImmediatePropagation();return}!c.contains(o)&&o!==t.document.body&&o!==t.document.documentElement||(e.preventDefault(),e.stopImmediatePropagation())};t.addEventListener("wheel",e=>{!e.ctrlKey&&Math.abs(e.deltaY)>Math.abs(e.deltaX)&&h(e)},i),t.addEventListener("keydown",e=>{!e.ctrlKey&&!e.metaKey&&!e.altKey&&["ArrowUp","ArrowDown","PageUp","PageDown"].includes(e.key)&&h(e)},i);let s;t.addEventListener("touchstart",e=>{const n=e.touches[0];s=n&&e.touches.length===1?{x:n.clientX,y:n.clientY}:void 0},{capture:!0,passive:!0});const y=e=>{const n=e.changedTouches[0];if(s&&n&&e.touches.length<=1){const o=Math.abs(n.clientY-s.y);o>8&&o>Math.abs(n.clientX-s.x)&&h(e)}e.type==="touchend"&&(s=void 0)};t.addEventListener("touchmove",y,i),t.addEventListener("touchend",y,i),t.addEventListener("touchcancel",()=>{s=void 0},!0);let r;t.addEventListener("pointerdown",e=>{r=e.pointerType==="touch"&&e.isPrimary?{id:e.pointerId,x:e.clientX,y:e.clientY}:void 0},!0);const d=e=>{if(!r||r.id!==e.pointerId)return;const n=Math.abs(e.clientY-r.y);n>8&&n>Math.abs(e.clientX-r.x)&&h(e),e.type==="pointerup"&&(r=void 0)};t.addEventListener("pointermove",d,i),t.addEventListener("pointerup",d,i),t.addEventListener("pointercancel",()=>{r=void 0},!0)}function b(a,t){v(a.singleVideo,t);const f=t.document;let p=0,i=!1;const h=()=>{try{const r="intentional:redirects",d=Date.now(),e=JSON.parse(t.sessionStorage.getItem(r)||"[]").filter(n=>d-n<1e4);if(e.length>=3)return!1;e.push(d),t.sessionStorage.setItem(r,JSON.stringify(e))}catch{}return!0},s=()=>{i=!1;const r=t.location.pathname+t.location.search,d=g(r,a.redirects);if(d!==null){h()&&t.location.replace(d);return}for(const e of a.select){if(!new RegExp(e.when).test(r)||f.querySelector(e.selected))continue;const n=f.querySelector(e.click),o=Date.now();n instanceof t.HTMLElement&&o-p>1e3&&(p=o,n.click())}},y=()=>{i||(i=!0,t.setTimeout(s,50))};for(const r of["pushState","replaceState"]){const d=t.history[r];t.history[r]=function(...e){const n=d.apply(this,e);return s(),n}}t.addEventListener("popstate",s),a.select.length>0&&new t.MutationObserver(y).observe(f,{childList:!0,subtree:!0}),t.setInterval(s,1e3),s()}var m={"bsky.app":{redirects:[{from:"^/profile/(bsky\\.app|did:plc:z72i7hdynmk6r22z27h6tvur)/feed/whats-hot/?(\\?|$)",to:"/?feed=following"},{from:"^/profile/(trending\\.bsky\\.app|did:plc:qrz3lhbyuxbeilrc6nekdqme)/feed/",to:"/?feed=following"},{from:"^/\\?(.*&)?feed=feedgen(%7[Cc]|\\|)at(%3[Aa]|:)(%2[Ff]|/){2}did(%3[Aa]|:)plc(%3[Aa]|:)z72i7hdynmk6r22z27h6tvur(%2[Ff]|/)app\\.bsky\\.feed\\.generator(%2[Ff]|/)whats-hot(&|$)",to:"/?feed=following"}],select:[{when:"^/(\\?.*)?$",click:'[role="tab"]:has([data-testid="homeScreenFeedTabs-Following"])',selected:'[data-testid="homeScreen"] > div:not([style*="display: none"]) > [data-testid$="FeedPage"]:not([data-nosnippet])'}]}}[location.hostname];m&&b(m,window)})();