Skip to content

Commit

Permalink
0.4.3 (#312)
Browse files Browse the repository at this point in the history
* [chore] bump version string

* [Feat] get users from tweet like pages (#286)

* [fix] remove duplicate regex part

* [feat] add scraping from the tweet engagements likes tab

* [chore] bump version string

* [fix] ignore empty user_result objects

* use exponential backoff when messaging background script (#285)

* use exponential backoff when messaging bgscript in case it's down

* break backoff into standalone func

---------

Co-authored-by: dani <[email protected]>

* [feat] add support for getting users from hidden replies page (#305)

* add support for checking hidden replies

* [chore] bump version string

---------

Co-authored-by: Rouge <[email protected]>

* Rewrite EscapeHTML func to be safer (#295)

* [fix] Rewrite EscapeHTML func to be safer

* [fix] explicitly replace <, >, and &

H/T @bkh555 for posting OSWAP guidelines <3

* [fix] make ampersand regex global, make sure not to catch ampersands in entities

* [fix] remove explicit <>& replacements

* Update release.yml

Bump browser-actions/release-firefox-addon from 0.1.3 to 0.1.4
Bumps [browser-actions/release-firefox-addon](https://github.com/browser-actions/release-firefox-addon) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/browser-actions/release-firefox-addon/releases)
- [Changelog](https://github.com/browser-actions/release-firefox-addon/blob/master/CHANGELOG.md)
- [Commits](browser-actions/release-firefox-addon@v0.1.3...v0.1.4)

* Add privacy policy within repo (#296)

* [chore] add privacy policy within repo

Yippie I get to use my rules lawyering brain for good instead of scaring the hoes :))))

* [fix] typos

lol oops

Co-authored-by: Eric Gallager <[email protected]>

---------

Co-authored-by: Eric Gallager <[email protected]>

* Make tabs more granular, reduce build size (#287)

* update tabs and cleanup some build files for a smaller zip

* [fix] Migrate users to new tabs

---------

Co-authored-by: dani <[email protected]>
Co-authored-by: Rouge <[email protected]>

* edit the privacy update a little bit

* spelling

---------

Co-authored-by: dani <[email protected]>
Co-authored-by: INSANEMODE <[email protected]>
Co-authored-by: Eric Gallager <[email protected]>
  • Loading branch information
4 people authored Aug 10, 2024
1 parent 7ffdafd commit 9d80421
Show file tree
Hide file tree
Showing 21 changed files with 581 additions and 342 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
make firefox
echo "filename=blue-blocker-firefox-$(make version).zip" >> "$GITHUB_OUTPUT"
- name: publish firefox
uses: browser-actions/[email protected].3 # https://github.com/marketplace/actions/release-firefox-addon#inputs
uses: browser-actions/[email protected].4 # https://github.com/marketplace/actions/release-firefox-addon#inputs
with:
addon-id: "{119be3f3-597c-4f6a-9caf-627ee431d374}"
addon-path: "${{ steps.build.outputs.filename }}"
Expand Down
File renamed without changes
113 changes: 111 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blue-blocker",
"version": "0.4.2",
"version": "0.4.3",
"author": "DanielleMiu",
"description": "Blocks all Twitter Blue verified users on twitter.com",
"type": "module",
Expand Down Expand Up @@ -34,5 +34,8 @@
"prettier": "^2.8.8",
"typescript": "^5.0.4",
"vite": "^2.9.18"
},
"dependencies": {
"html-minifier": "^4.0.0"
}
}
57 changes: 57 additions & 0 deletions privacy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Blue Blocker Privacy Policy

This privacy policy ("policy") will help you understand how Blue Blocker collects, uses, and protects the data you provide when you use the Blue Blocker extension/addon (herein: "the Extension").

This policy may change from time to time and we will do our best to promptly update you on changes. If you want to make sure that you are up to date with the latest changes, we advise you to visit the version of this policy hosted on [GitHub](https://github.com/kheina-com/Blue-Blocker/blob/main/privacy.md).

## What User Data the Extension Collects

- Session cookies set by the Twitter web client.
- CSRF tokens used in requests to the Twitter API.
- The URL of any request made by the Twitter web client to the Twitter API. These URLs may include the URLs of pages that you visit.
- Data sent to the Twitter web client by Twitter's servers ("Twitter data".)

## Why the Extension Collects Your Data

- Session cookies are used to authenticate requests to the blocking/muting endpoint of the Twitter API.
- CSRF tokens are used to allow requests to be sent and processed by Twitter.
- URLs are used to filter responses and to parse responses in order to extract Twitter user objects.
- Twitter data is used to determine whether a Twitter user should be blocked, and to properly form requests to the blocking/muting endpoint of the Twitter API.
- Twitter usernames, display names, and user IDs contained in this data are additionally used to create a history of users that have been blocked by the extension, and generate a list of users to not block in the future.
- This data may also be used to allow other extensions or addons to add additional checks in determining if the user should be blocked.

**Your data will never be used for any commercial purposes.**

## What User Data is Stored by the Extension

We are committed to safeguarding all data that you provide to the Extension. We have done everything in our power to prevent data theft, unauthorized access, and disclosure by storing as much data locally as is feasible, and only using well understood browser APIs to store your data.

Session cookies and CSRF tokens are stored locally by the Extension.

URLs collected are discarded after their use, and never stored.

Twitter data that is not the username, display name, or user ID is discarded immediately after use, and never stored.

Usernames, display names, and user IDs of blocked users are stored locally.

Usernames, display names, and user IDs of unblocked users is stored within the synced portion of your browser's extension data store.

## What User Data is Shared With Third Parties

The public user data sent by the Twitter API are parsed by the Extension, or extensions/addons you have opted to integrate with, and determines what user IDs are transmitted back to the Twitter API in order to block the user.

You can optionally configure the Extension to send the Twitter data it collects to other extensions/addons ("integrations"). Data is never shared without your explicit consent, and you may revoke consent at any time. We advise you to refer to the Privacy Policies of the extensions/addons that you enable data sharing with to understand how those extensions collect, store, and use the data you provide to them.

**No other user data is shared with any outside parties.**

## How to Opt Out of Data Collection, Usage, and Storage

We have made our best effort to limit the data that is collected, used, and stored to only the data that is essential to the function of the Extension. Therefore opting out of collection, usage, and/or storage of your data will make the Extension non-functional.

If at any time you wish to no longer allow the Extension to collect, store, or use your data, we advise you to immediately uninstall the Extension.

## Data Deletion

You can delete all data related to or stored by the Extension at any time by uninstalling the Extension.

You can delete all data related to unblocked users at any time by navigating to the "advanced" tab of the Extension's popup and clicking the "clear" button in the safelist section.
Binary file removed public/icon/icon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions src/content/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ document.addEventListener('blue-blocker-event', function (e: CustomEvent<BlueBlo
case 'SearchTimeline':
case 'UserTweets':
case 'TweetDetail':
case 'ModeratedTimeline':
case 'Following':
case 'Followers':
case 'UserCreatorSubscriptions':
case 'FollowersYouKnow':
case 'BlueVerifiedFollowers':
case 'Favoriters':
return HandleInstructionsResponse(e, parsed_body, compileConfig(config));
case 'timeline/home.json':
case 'search/adaptive.json':
Expand Down
6 changes: 2 additions & 4 deletions src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ interface RegisterRequest {
name: string;
}

interface MessageResponse {
status: MessageStatus;
}

interface SuccessResponse {
status: SuccessStatus;
result: any;
Expand All @@ -135,6 +131,8 @@ interface ErrorResponse {
message: string;
}

type MessageResponse = SuccessResponse | ErrorResponse;

interface ExternalBlockResponse {
block: boolean;
reason?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/injected/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(function (xhr) {
// TODO: find a way to make this cleaner
const RequestRegex =
/^https?:\/\/(?:\w+\.)?(?:twitter|x)\.com\/[\w\/\.\-\_\=]+\/(HomeLatestTimeline|HomeTimeline|Followers|Following|SearchTimeline|UserTweets|UserCreatorSubscriptions|FollowersYouKnow|BlueVerifiedFollowers|SearchTimeline|timeline\/home\.json|TweetDetail|search\/typeahead\.json|search\/adaptive\.json|blocks\/destroy\.json|mutes\/users\/destroy\.json)(?:$|\?)/;
/^https?:\/\/(?:\w+\.)?(?:twitter|x)\.com\/[\w\/\.\-\_\=]+\/(HomeLatestTimeline|HomeTimeline|Followers|Following|SearchTimeline|UserTweets|Favoriters|UserCreatorSubscriptions|FollowersYouKnow|BlueVerifiedFollowers|timeline\/home\.json|TweetDetail|ModeratedTimeline|search\/typeahead\.json|search\/adaptive\.json|blocks\/destroy\.json|mutes\/users\/destroy\.json)(?:$|\?)/;

let XHR = <BlueBlockerXLMRequest>XMLHttpRequest.prototype;
let open = XHR.open;
Expand Down
2 changes: 1 addition & 1 deletion src/injected/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
display: flex;
justify-content: center;
align-items: center;
background: url('/icon/icon.png') var(--bg1color);
background: url('/icon/icon-128.png') var(--bg1color);
background-repeat: no-repeat;
background-size: 2.5em;
background-position-x: 1em;
Expand Down
4 changes: 2 additions & 2 deletions src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { defineManifest } from '@crxjs/vite-plugin';
export default defineManifest({
name: 'Blue Blocker',
description: 'Blocks all Twitter Blue verified users on twitter.com',
version: '0.4.2',
version: '0.4.3',
manifest_version: 3,
icons: {
'128': 'icon/icon-128.png',
},
action: {
default_popup: 'src/popup/index.html',
default_icon: 'icon/icon.png',
default_icon: 'icon/icon-128.png',
},
background: {
service_worker: 'src/background/index.ts',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ main {
display: flex;
justify-content: center;
align-items: center;
background: url('/icon/icon.png') var(--bg2color);
background: url('/icon/icon-128.png') var(--bg2color);
background-repeat: no-repeat;
background-size: 2.5em;
background-position-x: 1em;
Expand Down
8 changes: 7 additions & 1 deletion src/parsers/instructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ const InstructionsPaths: { [key: string]: string[] } = {
HomeLatestTimeline: ['data', 'home', 'home_timeline_urt', 'instructions'],
HomeTimeline: ['data', 'home', 'home_timeline_urt', 'instructions'],
SearchTimeline: ['data', 'search_by_raw_query', 'search_timeline', 'timeline', 'instructions'],
Favoriters: ['data', 'favoriters_timeline', 'timeline', 'instructions'],
UserTweets: ['data', 'user', 'result', 'timeline_v2', 'timeline', 'instructions'],
Followers: ['data', 'user', 'result', 'timeline', 'timeline', 'instructions'],
Following: ['data', 'user', 'result', 'timeline', 'timeline', 'instructions'],
UserCreatorSubscriptions: ['data', 'user', 'result', 'timeline', 'timeline', 'instructions'],
FollowersYouKnow: ['data', 'user', 'result', 'timeline', 'timeline', 'instructions'],
BlueVerifiedFollowers: ['data', 'user', 'result', 'timeline', 'timeline', 'instructions'],
TweetDetail: ['data', 'threaded_conversation_with_injections_v2', 'instructions'],
ModeratedTimeline: ['data', 'tweet', 'result', 'timeline_response','timeline', 'instructions' ],
'search/adaptive.json': ['timeline', 'instructions'],
};
// this is the path to retrieve the user object from the individual tweet
Expand All @@ -33,7 +35,11 @@ const IgnoreTweetTypes = new Set(['TimelineTimelineCursor']);
const PromotedStrings = new Set(['suggest_promoted', 'Promoted', 'promoted']);

function handleUserObject(obj: any, config: CompiledConfig, from_blue: boolean) {
let userObj = obj.user_results.result;
let userObj = obj.user_results?.result;
if (!userObj) {
console.log(logstr, 'empty user result');
return;
}

if (userObj.__typename === 'UserUnavailable') {
console.log(logstr, 'user is unavailable', userObj);
Expand Down
Loading

0 comments on commit 9d80421

Please sign in to comment.