From 4d125c1353c93afb8185a6cdce4d1f62203e0a98 Mon Sep 17 00:00:00 2001 From: yusukesaitoh Date: Fri, 30 Oct 2020 02:30:12 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AD=E3=83=AF?= =?UTF-8?q?=E3=83=BC=E6=95=B0=E3=80=81=E3=83=95=E3=82=A9=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E4=B8=AD=E6=95=B0=E3=81=8C=E9=9A=A0=E3=82=8C=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E5=86=8D=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/styles/contentscript.scss | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/app/styles/contentscript.scss b/app/styles/contentscript.scss index dde5147..6c4c406 100644 --- a/app/styles/contentscript.scss +++ b/app/styles/contentscript.scss @@ -76,10 +76,7 @@ body { div.r-u8s1d div.r-1upvrn0, div.r-u8s1d div.r-xnswec, div.r-u8s1d div.r-qo02w8 { - div.css-1dbjc4n.r-18u37iz.r-1w6e6rj - > div:first-child - > a - > span.r-vw2c0b { + div.css-1dbjc4n.r-18u37iz.r-1w6e6rj>div:first-child>a>span:first-child { display: none !important; } } @@ -90,31 +87,31 @@ body { > div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:first-child > a - > span.r-vw2c0b, + > span:first-child, & > div.css-1dbjc4n.r-1cad53l > div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:first-child > a - > span.r-vw2c0b, + > span:first-child, & > div.css-1dbjc4n.r-ku1wi2 > div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:first-child > a - > span.r-vw2c0b, + > span:first-child, & > div.css-1dbjc4n.r-1ifxtd0 > div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:first-child > a - > span.r-vw2c0b, + > span:first-child, & > div.css-1dbjc4n.r-le4sbl > div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:first-child > a - > span.r-vw2c0b { + > span:first-child { display: none !important; } } @@ -124,7 +121,7 @@ body { div.r-u8s1d div.r-1upvrn0, div.r-u8s1d div.r-xnswec, div.r-u8s1d div.r-qo02w8 { - div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:last-child > a > span.r-vw2c0b { + div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:last-child > a > span:first-child { display: none !important; } } @@ -135,31 +132,31 @@ body { > div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:last-child > a - > span.r-vw2c0b, + > span:first-child, & > div.css-1dbjc4n.r-1cad53l > div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:last-child > a - > span.r-vw2c0b, + > span:first-child, & > div.css-1dbjc4n.r-ku1wi2 > div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:last-child > a - > span.r-vw2c0b, + > span:first-child, & > div.css-1dbjc4n.r-1ifxtd0 > div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:last-child > a - > span.r-vw2c0b, + > span:first-child, & > div.css-1dbjc4n.r-le4sbl > div.css-1dbjc4n.r-18u37iz.r-1w6e6rj > div:last-child > a - > span.r-vw2c0b { + > span:first-child { display: none !important; } } From 3b12c3c48694c486f9b7d40d0880bef5d1a22cb6 Mon Sep 17 00:00:00 2001 From: yusukesaitoh Date: Fri, 30 Oct 2020 02:59:08 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E3=81=8A=E3=81=99=E3=81=99=E3=82=81?= =?UTF-8?q?=E3=83=88=E3=83=94=E3=83=83=E3=82=AF=E3=80=81=E3=81=8A=E3=81=99?= =?UTF-8?q?=E3=81=99=E3=82=81=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=82=92?= =?UTF-8?q?=E9=9A=A0=E3=81=99=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/_locales/en/messages.json | 6 ++++++ app/_locales/ja/messages.json | 6 ++++++ app/pages/popup.html | 8 ++++++++ app/scripts/contentscript.ts | 4 ++-- app/scripts/popup.ts | 4 ++-- app/styles/contentscript.scss | 18 ++++++++++++++++++ 6 files changed, 42 insertions(+), 4 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 30e038b..336c90f 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -36,6 +36,12 @@ "titleIsReactionNumberAlwaysHidden": { "message": "Hide numbers of replies, retweets, and likes when mouse cursor is hovered" }, + "titleIsTopicsToFollowHidden": { + "message": "Hide Topics to follow" + }, + "titleIsWhoToFollowHidden": { + "message": "Hide Who to follow" + }, "titleAdditionalSettings": { "message": "Additional settings" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 2fbecfe..795d34c 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -32,6 +32,12 @@ "titleIsReactionNumberAlwaysHidden": { "message": "カーソルをツイートにのせてもリプライ数、リツイート数、いいね数を隠す" }, + "titleIsTopicsToFollowHidden": { + "message": "おすすめトピックを隠す" + }, + "titleIsWhoToFollowHidden": { + "message": "おすすめユーザーを隠す" + }, "titleAdditionalSettings": { "message": "追加設定" }, diff --git a/app/pages/popup.html b/app/pages/popup.html index cf35d4a..2bff0ef 100644 --- a/app/pages/popup.html +++ b/app/pages/popup.html @@ -36,6 +36,14 @@

__MSG_titleAdditionalSettings__

__MSG_titleIsReactionNumberAlwaysHidden__ + + diff --git a/app/scripts/contentscript.ts b/app/scripts/contentscript.ts index e5013d9..6240b6e 100644 --- a/app/scripts/contentscript.ts +++ b/app/scripts/contentscript.ts @@ -1,4 +1,4 @@ -toggleClass(["isExploreHidden", "isTrendsHidden", "isReactionNumberHidden", "showCalmText", "isFollowingNumberHidden", "isFollowerNumberHidden", "isReactionNumberAlwaysHidden"]); +toggleClass(["isExploreHidden", "isTrendsHidden", "isReactionNumberHidden", "showCalmText", "isFollowingNumberHidden", "isFollowerNumberHidden", "isReactionNumberAlwaysHidden", "isWhoToFollowHidden", "isTopicsToFollowHidden"]); addCalmTitle(); for (let i = 0; i < 2; i++) { setTimeout(changeCalmColor, (i + 1)*100); @@ -7,7 +7,7 @@ for (let i = 0; i < 2; i++) { function toggleClass(keys: string[]) { chrome.storage.local.get(keys, function (data) { keys.forEach(key => { - if (key === "isFollowingNumberHidden" || key === "isFollowerNumberHidden" || key === "isReactionNumberAlwaysHidden") { + if (key === "isFollowingNumberHidden" || key === "isFollowerNumberHidden" || key === "isReactionNumberAlwaysHidden" || key === "isWhoToFollowHidden" || key === "isTopicsToFollowHidden") { if (typeof data[key] === "undefined") { data[key] = false; } diff --git a/app/scripts/popup.ts b/app/scripts/popup.ts index f6a3e49..e1d3628 100644 --- a/app/scripts/popup.ts +++ b/app/scripts/popup.ts @@ -1,5 +1,5 @@ localize(); -initValues(["isExploreHidden", "isTrendsHidden", "isReactionNumberHidden", "showCalmText", "isFollowingNumberHidden", "isFollowerNumberHidden", "isReactionNumberAlwaysHidden"]); +initValues(["isExploreHidden", "isTrendsHidden", "isReactionNumberHidden", "showCalmText", "isFollowingNumberHidden", "isFollowerNumberHidden", "isReactionNumberAlwaysHidden", "isWhoToFollowHidden", "isTopicsToFollowHidden"]); function localize() { var objects = document.getElementsByTagName('html'); @@ -37,7 +37,7 @@ function toggleChecked(keys: string[]) { chrome.storage.local.get(keys, function (data) { keys.forEach(key => { console.log(key + ": " + data[key]); - if (key === "isFollowingNumberHidden" || key === "isFollowerNumberHidden" || key === "isReactionNumberAlwaysHidden") { + if (key === "isFollowingNumberHidden" || key === "isFollowerNumberHidden" || key === "isReactionNumberAlwaysHidden" || key === "isWhoToFollowHidden" || key === "isTopicsToFollowHidden") { if (typeof data[key] === "undefined") { data[key] = false; } diff --git a/app/styles/contentscript.scss b/app/styles/contentscript.scss index 6c4c406..dc44668 100644 --- a/app/styles/contentscript.scss +++ b/app/styles/contentscript.scss @@ -161,4 +161,22 @@ body { } } } + + &.isWhoToFollowHidden { + div[data-testid=primaryColumn] div.css-1dbjc4n[data-testid=UserCell] { + display: none; + } + div[data-testid=primaryColumn] a[href*="/i/connect_people?user_id="] { + display: none; + } + } + + &.isTopicsToFollowHidden { + div[data-testid=primaryColumn] a[aria-labelledby*=" topic-name"] { + display: none; + } + div[data-testid=primaryColumn] a[href*="/i/flow/topics_selector"] { + display: none; + } + } } From de700940b52f878c43a82a2685bfc74780d7972f Mon Sep 17 00:00:00 2001 From: yusukesaitoh Date: Fri, 30 Oct 2020 02:59:17 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scripts/contentscript.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/scripts/contentscript.ts b/app/scripts/contentscript.ts index 6240b6e..cad18be 100644 --- a/app/scripts/contentscript.ts +++ b/app/scripts/contentscript.ts @@ -28,6 +28,7 @@ function toggleClass(keys: string[]) { chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { toggleClass([request.key]); + sendResponse(); }); chrome.runtime.sendMessage({ from: 'content', subject: 'showPageAction' }); From 7cced32fa98e986d0c316207a99a0d520001bd01 Mon Sep 17 00:00:00 2001 From: yusukesaitoh Date: Fri, 30 Oct 2020 03:00:54 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/manifest.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/manifest.json b/app/manifest.json index dacde58..dd294f5 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -2,7 +2,7 @@ "name": "__MSG_appName__", "short_name": "__MSG_appShortName__", "description": "__MSG_appDescription__", - "version": "1.0.4", + "version": "1.1.0", "manifest_version": 2, "default_locale": "en", "icons": { diff --git a/package.json b/package.json index 3a953c0..b675162 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "calm-twitter", "private": true, - "version": "1.0.4", + "version": "1.1.0", "description": "This extension hides trending information from twitter timelines to make your mind calm.", "scripts": { "start": "npm run dev:chrome",