-
-
Save PSingletary/eafb9b0eb4c2033148ffb7acbfc48740 to your computer and use it in GitHub Desktop.
Revisions
-
mary-ext revised this gist
Feb 14, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ globalThis.fetch = function (req, init) { // remove feed interaction tracking case '/xrpc/app.bsky.feed.sendInteractions': return req.clone().json().then((data) => { data.interactions = data.interactions.filter((evt) => { switch (evt.event) { // requestLess and requestMore is a user-explicit action -
mary-ext revised this gist
Feb 14, 2025 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ globalThis.fetch = function (req, init) { return req.json().then((data) => { data.interactions = data.interactions.filter((evt) => { switch (evt.event) { // requestLess and requestMore is a user-explicit action case 'app.bsky.feed.defs#requestLess': case 'app.bsky.feed.defs#requestMore': return true; @@ -26,6 +26,7 @@ globalThis.fetch = function (req, init) { return false; }); // nothing to send, don't bother contacting if (data.interactions.length === 0) { return Response.json({}); } -
mary-ext revised this gist
Feb 14, 2025 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,11 @@ globalThis.fetch = function (req, init) { // remove trending topics case '/xrpc/app.bsky.unspecced.getTrendingTopics': return Response.json({ suggested: [], topics: [] }); // remove follow suggestions case '/xrpc/app.bsky.actor.getSuggestions': return Response.json({ actors: [] }); // remove feed interaction tracking case '/xrpc/app.bsky.feed.sendInteractions': return req.json().then((data) => { @@ -20,14 +22,14 @@ globalThis.fetch = function (req, init) { case 'app.bsky.feed.defs#requestMore': return true; } return false; }); if (data.interactions.length === 0) { return Response.json({}); } req = new Request(req, { body: JSON.stringify(data) }); return _fetch.call(this, req); }); @@ -50,4 +52,4 @@ XMLHttpRequest.prototype.open = function (method, url, isAsync, user, password) } return _open.call(this, method, url, isAsync, user, password); }; -
mary-ext revised this gist
Feb 14, 2025 . 1 changed file with 5 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,24 +15,16 @@ globalThis.fetch = function (req, init) { return req.json().then((data) => { data.interactions = data.interactions.filter((evt) => { switch (evt.event) { // requestLess and requestMore is a user-explicit action. case 'app.bsky.feed.defs#requestLess': case 'app.bsky.feed.defs#requestMore': return true; } return false; }); if (data.interactions.length === 0) { return Response.json({}); } -
mary-ext revised this gist
Feb 14, 2025 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,6 +31,11 @@ globalThis.fetch = function (req, init) { return true }); if (data.interactions.length === 0) { console.log('interaction blocked'); return Response.json({}); } req = new Request(req, { body: JSON.stringify(data) }); return _fetch.call(this, req); }); -
mary-ext created this gist
Feb 14, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ bsky.app##+js(user-bsky-annoyances.js) main.bsky.dev##+js(user-bsky-annoyances.js) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,56 @@ const _fetch = globalThis.fetch; globalThis.fetch = function (req, init) { if (req instanceof Request) { const url = new URL(req.url); switch (url.pathname) { // remove trending topics case '/xrpc/app.bsky.unspecced.getTrendingTopics': return Response.json({ suggested: [], topics: [] }); // remove follow suggestions case '/xrpc/app.bsky.actor.getSuggestions': return Response.json({ actors: [] }); // remove feed interaction tracking case '/xrpc/app.bsky.feed.sendInteractions': return req.json().then((data) => { data.interactions = data.interactions.filter((evt) => { switch (evt.event) { case 'app.bsky.feed.defs#clickthroughItem': case 'app.bsky.feed.defs#clickthroughAuthor': case 'app.bsky.feed.defs#clickthroughReposter': case 'app.bsky.feed.defs#clickthroughEmbed': case 'app.bsky.feed.defs#interactionSeen': case 'app.bsky.feed.defs#interactionLike': case 'app.bsky.feed.defs#interactionRepost': case 'app.bsky.feed.defs#interactionReply': case 'app.bsky.feed.defs#interactionQuote': case 'app.bsky.feed.defs#interactionShare': return false; } return true }); req = new Request(req, { body: JSON.stringify(data) }); return _fetch.call(this, req); }); } } else if (req === 'https://bsky.app/ipcc') { // remove regional moderation (germany, brazil) return Response.json({ countryCode: 'US' }); } return _fetch.call(this, req, init); }; const _open = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function (method, url, isAsync, user, password) { // remove video session tracking { // `video.bsky.app` is a middleware that adds session tracking, // the actual files lives on `video.cdn.bsky.app` url = url.replace('://video.bsky.app/watch/', '://video.cdn.bsky.app/hls/'); } return _open.call(this, method, url, isAsync, user, password); };