Skip to content

Commit

Permalink
2.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dmstern committed Jan 11, 2022
1 parent 608e6f8 commit 9092896
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion assets/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "__MSG_extensionName__",
"version": "2.3.4",
"version": "2.3.5",
"description": "__MSG_extensionDescription__",
"icons": {
"16": "icon16.png",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "likes-blocker",
"version": "2.3.4",
"version": "2.3.5",
"description": "Block all visible likers (and optionally all retweeters) of a tweet on Twitter.",
"main": "dist/script.js",
"scripts": {
Expand Down
19 changes: 8 additions & 11 deletions src/LikersBlocker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export default class LikersBlocker {
this.legacyTwitter = legacyTwitter;
}


public get tweetId() {
return location.href.replace(/https:\/\/twitter.com\/.*\/status\//g, "").replace(
"/likes",
Expand Down Expand Up @@ -203,8 +202,8 @@ export default class LikersBlocker {
let userCells: NodeListOf<HTMLAnchorElement> = this.isLegacyTwitter
? (await this.getScrollList()).querySelectorAll("a.js-user-profile-link")
: (await this.getScrollList()).querySelectorAll(
'[data-testid="UserCell"] a[aria-hidden="true"]',
);
'[data-testid="UserCell"] a[aria-hidden="true"]',
);

let users: Array<HTMLAnchorElement> = Array.from(userCells);

Expand All @@ -222,11 +221,11 @@ export default class LikersBlocker {
let followButton: HTMLElement = this.isLegacyTwitter
? await tryToAccessDOM("button.button-text.follow-text")
: await tryToAccessDOM(
"[role=button] [role=button]",
false,
1,
await this.getScrollList(),
);
"[role=button] [role=button]",
false,
1,
await this.getScrollList(),
);

// prevent multiple blockButtons:
if (document.querySelector("[data-testid=blockAll]")) {
Expand Down Expand Up @@ -707,9 +706,7 @@ export default class LikersBlocker {
return;
}

let blockedListContainer = await tryToAccessDOM(
"section", true, 3
);
let blockedListContainer = await tryToAccessDOM("section", true, 3);

if (!blockedListContainer) {
return;
Expand Down
3 changes: 1 addition & 2 deletions src/TwitterPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class TwitterPage {
return (
location.href.includes("list") &&
(location.href.endsWith("members") ||
location.href.endsWith("subscribers"))
location.href.endsWith("subscribers"))
);
}

Expand All @@ -45,5 +45,4 @@ export default class TwitterPage {
static get viewport() {
return this.isMobile ? "mobile" : "desktop";
}

}

0 comments on commit 9092896

Please sign in to comment.