From 5b05b1bdc61980a76981a4269dc5d0f5eb69230d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=81=BC=E3=81=84=E3=82=93?= <50550561+Robot-Inventor@users.noreply.github.com> Date: Wed, 14 Jun 2023 02:35:52 +0900 Subject: [PATCH] fix: false detections can occur when possibly_sensitionive_editable is null #16 (#20) --- src/ts/core/tweetChecker.ts | 7 ++++--- userScript/en.user.js | 2 +- userScript/ja.user.js | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ts/core/tweetChecker.ts b/src/ts/core/tweetChecker.ts index 2e19f9fd..7e679f59 100644 --- a/src/ts/core/tweetChecker.ts +++ b/src/ts/core/tweetChecker.ts @@ -19,12 +19,13 @@ class TweetChecker { const reactProps = new TweetReactProps(menuBar).get(); const tweetStatus: TweetStatus = { tweet: { - possiblySensitive: reactProps.possibly_sensitive, - possiblySensitiveEditable: reactProps.possibly_sensitive_editable, + possiblySensitive: Boolean(reactProps.possibly_sensitive), + // ref: https://github.com/Robot-Inventor/shadowban-scanner/issues/16 + possiblySensitiveEditable: !(reactProps.possibly_sensitive_editable === false), isTweetByCurrentUser: reactProps.user.following === null }, user: { - possiblySensitive: reactProps.user.possibly_sensitive + possiblySensitive: Boolean(reactProps.user.possibly_sensitive) } }; diff --git a/userScript/en.user.js b/userScript/en.user.js index 3fe1e076..13b03c14 100644 --- a/userScript/en.user.js +++ b/userScript/en.user.js @@ -13,4 +13,4 @@ // @grant none // ==/UserScript== -(()=>{"use strict";var e={402:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(213),a=s.n(n),r=s(645),o=s.n(r)()(a());o.push([e.id,".shadowban-scanner-message {\n padding: 1em;\n border-radius: 0.5em;\n background: rgb(255, 0, 0, 0.2);\n margin: 1em 0;\n}\n\n.shadowban-scanner-message-no-problem {\n background: rgb(0, 255, 0, 0.2);\n}\n\n.shadowban-scanner-message button {\n cursor: pointer;\n color: inherit;\n border: none;\n background: none;\n}\n\n.shadowban-scanner-message pre {\n font-family: inherit;\n line-height: inherit;\n margin: 0.5rem 0 0 0;\n}\n",""]);const i=o},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var s="",n=void 0!==t[5];return t[4]&&(s+="@supports (".concat(t[4],") {")),t[2]&&(s+="@media ".concat(t[2]," {")),n&&(s+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),s+=e(t),n&&(s+="}"),t[2]&&(s+="}"),t[4]&&(s+="}"),s})).join("")},t.i=function(e,s,n,a,r){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(n)for(var i=0;i0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),s&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=s):l[2]=s),a&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=a):l[4]="".concat(a)),t.push(l))}},t}},213:e=>{e.exports=function(e){return e[1]}},962:(e,t,s)=>{s.r(t),s.d(t,{default:()=>b});var n=s(379),a=s.n(n),r=s(795),o=s.n(r),i=s(569),c=s.n(i),d=s(565),l=s.n(d),u=s(216),p=s.n(u),w=s(589),h=s.n(w),m=s(402),g={};g.styleTagTransform=h(),g.setAttributes=l(),g.insert=c().bind(null,"head"),g.domAPI=o(),g.insertStyleElement=p(),a()(m.Z,g);const b=m.Z&&m.Z.locals?m.Z.locals:void 0},379:e=>{var t=[];function s(e){for(var s=-1,n=0;n{var t={};e.exports=function(e,s){var n=function(e){if(void 0===t[e]){var s=document.querySelector(e);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(e){s=null}t[e]=s}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(s)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,s)=>{e.exports=function(e){var t=s.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(s){!function(e,t,s){var n="";s.supports&&(n+="@supports (".concat(s.supports,") {")),s.media&&(n+="@media ".concat(s.media," {"));var a=void 0!==s.layer;a&&(n+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),n+=s.css,a&&(n+="}"),s.media&&(n+="}"),s.supports&&(n+="}");var r=s.sourceMap;r&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,s)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},36:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Color=void 0,t.Color=class{constructor(){}get textColor(){const e=document.querySelector("[data-testid='User-Name'] div:first-child span, [data-testid='UserName'] div:first-child span");if(!e)throw new Error("Failed to get user name span of tweet");const{color:t}=getComputedStyle(e);return t}}},564:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Core=void 0;const n=s(296),a=s(915),r=s(338);s(962),t.Core=class{constructor(e){const t=new MutationObserver((()=>{const t=document.querySelectorAll(`[data-testid="tweet"]:not([${a.CHECKED_DATA_ATTRIBUTE}]`);for(const s of t)new r.TweetChecker(s).run(),e();const s=document.querySelector(`:not([data-testid="tweet"]) [data-testid="UserName"]:not([${a.CHECKED_DATA_ATTRIBUTE}])`);s&&(new n.ProfileChecker(s).run(),e())})),s=new MutationObserver((()=>{const e=document.querySelector("main");e&&(s.disconnect(),t.observe(e,{subtree:!0,childList:!0}))}));s.observe(document.body,{subtree:!0,childList:!0})}}},552:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageElement=void 0;const n=s(915);t.MessageElement=class{constructor(e,t,s){if(this.div=document.createElement("div"),this.div.classList.add(n.MESSAGE_CLASS_NAME),this.div.dataset.messageType=s,this.div.style.color=t,"tweet"===e){const e=document.createElement("pre");e.style.display="none",this.div.appendChild(e);const t=document.createElement("button");t.addEventListener("click",(()=>{e.style.display="block",t.remove()})),this.div.appendChild(t)}}set messageType(e){this.div.dataset.messageType=e}get element(){return this.div}}},531:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageType=void 0,t.MessageType=class{constructor(){}fromTweetStatus(e){return e.user.possiblySensitive||e.tweet.possiblySensitive?e.user.possiblySensitive?e.tweet.possiblySensitive?e.tweet.possiblySensitiveEditable?"accountShadowbannedAndTweetFlaggedAsSensitive":"accountAndTweetShadowbanned":"accountShadowbanned":e.tweet.possiblySensitiveEditable?"tweetFlaggedAsSensitive":"tweetShadowbanned":"tweetNoProblem"}}},296:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileChecker=void 0;const n=s(36),a=s(552),r=s(204),o=s(915);t.ProfileChecker=class{constructor(e){this.userName=e}run(){this.userName.setAttribute(o.CHECKED_DATA_ATTRIBUTE,"true");const e=new r.ProfileReactProps(this.userName).get();if(!Boolean(e.user.possibly_sensitive))return;const t=(new n.Color).textColor,s=new a.MessageElement("account",t,"accountShadowbanned"),i=document.querySelector("[data-testid='UserDescription']");if(!i)throw new Error("Failed to get user description of profile");i.insertAdjacentElement("afterend",s.element)}}},204:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileReactProps=t.TweetReactProps=void 0;class s{constructor(e){this.element=e,this.reactPropsName=Object.getOwnPropertyNames(e).filter((e=>e.startsWith("__reactProps$")))[0]}get(){return this.element[this.reactPropsName].children[1].props}}t.TweetReactProps=class{constructor(e){this.tweet=e}get(){return new s(this.tweet).get().retweetWithCommentLink.state.quotedStatus}},t.ProfileReactProps=class{constructor(e){this.userName=e}get(){return new s(this.userName).get()}}},338:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TweetChecker=void 0;const n=s(36),a=s(552),r=s(531),o=s(204),i=s(915);t.TweetChecker=class{constructor(e){this.tweet=e}run(){this.tweet.setAttribute(i.CHECKED_DATA_ATTRIBUTE,"true");const e=this.tweet.querySelector("div[role='group'][id]");if(!e)throw new Error("Failed to get menu bar of tweet");const t=new o.TweetReactProps(e).get(),s={tweet:{possiblySensitive:t.possibly_sensitive,possiblySensitiveEditable:t.possibly_sensitive_editable,isTweetByCurrentUser:null===t.user.following},user:{possiblySensitive:t.user.possibly_sensitive}},c=(new n.Color).textColor,d=new a.MessageElement("tweet",c);s.tweet.isTweetByCurrentUser&&d.element.classList.add(i.CURRENT_USERS_TWEET_CLASS_NAME);const l=(new r.MessageType).fromTweetStatus(s);d.messageType=l,"tweetNoProblem"===l&&d.element.classList.add("shadowban-scanner-message-no-problem"),e.insertAdjacentElement("beforebegin",d.element)}}},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SETTINGS=void 0,t.DEFAULT_SETTINGS={alwaysDetailedView:!1,showMessageInAllTweets:!1,enableOnlyForCurrentUsersTweets:!1}},915:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MESSAGE_CLASS_NAME=t.CURRENT_USERS_TWEET_CLASS_NAME=t.EVENT_GENERATOR_ID=t.CHECKED_DATA_ATTRIBUTE=void 0,t.CHECKED_DATA_ATTRIBUTE="data-shadowban-checked",t.EVENT_GENERATOR_ID="shadowban-scanner-event-generator",t.CURRENT_USERS_TWEET_CLASS_NAME="tweet-by-current-user",t.MESSAGE_CLASS_NAME="shadowban-scanner-message"},34:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFlow=void 0;const n=s(915);t.TextFlow=class{constructor(e){if(!e.showMessageInAllTweets){const e=document.createElement("style");e.textContent=".shadowban-scanner-message-no-problem { display: none; }",document.body.appendChild(e)}if(e.enableOnlyForCurrentUsersTweets){const e=document.createElement("style");e.textContent=`.${n.MESSAGE_CLASS_NAME}:not(.${n.CURRENT_USERS_TWEET_CLASS_NAME}) {display: none;}`,document.body.appendChild(e)}this.allWaysDetailedView=e.alwaysDetailedView,this.translator=e.translator}run(){const e=document.querySelector(".shadowban-scanner-message:not(.text-inserted");if(!e)return;e.classList.add("text-inserted");const{messageType:t}=e.dataset;if(!t)throw new Error("Failed to get message type");const s=this.translator(t);e.insertAdjacentText("afterbegin",s);const n=e.querySelector("button");if(!n)return;this.allWaysDetailedView?n.click():n.textContent=this.translator("showMore");const a=e.querySelector("pre");a&&(a.textContent=this.translator(`${t}StatusMessage`))}}},798:function(e,t,s){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(s(533));new(s(651).UserScriptBase)(a.default)},651:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UserScriptBase=void 0;const n=s(564),a=s(34),r=s(294);t.UserScriptBase=class{constructor(e){const t=Object.assign(Object.assign({},r.DEFAULT_SETTINGS),{translator:t=>e[t].message}),s=new a.TextFlow(t);new n.Core((()=>{s.run()}))}}},533:e=>{e.exports=JSON.parse('{"manifest_description":{"message":"A browser extension that detects shadowbans on Twitter."},"accountShadowbanned":{"message":"This user may be shadowbanned, so this tweet may not appear in search results."},"accountShadowbannedStatusMessage":{"message":"🚫Account may be shadowbanned.\\n✅Tweet is not flagged as sensitive.\\n✅Tweet has no age limit.\\n🚫Tweet may not appear in search results."},"accountShadowbannedAndTweetFlaggedAsSensitive":{"message":"This user may be shadowbanned so this tweet may not appear in search results. Also, this tweet is flagged as sensitive."},"accountShadowbannedAndTweetFlaggedAsSensitiveStatusMessage":{"message":"🚫Account may be shadowbanned.\\n🚫Tweet is flagged as sensitive.\\n✅Tweet has no age limit.\\n🚫Tweet may not appear in search results."},"accountAndTweetShadowbanned":{"message":"This tweet is age-restricted and cannot be viewed by users under the age of 18 or who are not logged in. This tweet may not appear in search results."},"accountAndTweetShadowbannedStatusMessage":{"message":"🚫Account may be shadowbanned.\\n🚫Tweet is flagged as sensitive.\\n🚫Tweet has age limit.\\n🚫Tweet may not appear in search results."},"tweetFlaggedAsSensitive":{"message":"This tweet is flagged as sensitive and will not appear in search results depending on the viewer\'s preferences."},"tweetFlaggedAsSensitiveStatusMessage":{"message":"✅Account is not shadowbanned.\\n🚫Tweet is flagged as sensitive.\\n✅Tweet has no age limit.\\n⚠️Tweet may not appear in search results depending on viewer preferences."},"tweetShadowbanned":{"message":"This tweet is age-restricted and cannot be viewed by users under the age of 18 or who are not logged in. This tweet may not appear in search results."},"tweetShadowbannedStatusMessage":{"message":"✅Account is not shadowbanned.\\n🚫Tweet is flagged as sensitive.\\n🚫Tweet has age limit.\\n🚫Tweet may not appear in search results."},"tweetNoProblem":{"message":"No problems was found with this tweet."},"tweetNoProblemStatusMessage":{"message":"✅Account is not shadowbanned.\\n✅Tweet is not flagged as sensitive.\\n✅Tweet has no age limit.\\n✅Tweet will appear in search results."},"showMore":{"message":"▶show more"},"settingsAlwaysDetailedView":{"message":"Always display detailed information"},"settingsShowMessageInAllTweets":{"message":"Show check results in all tweets"},"settingsEnableOnlyForCurrentUsersTweets":{"message":"Display check results only in your own tweets (beta)"},"settingsPleaseReload":{"message":"Please reload Twitter once you have changed the settings."}}')}},t={};function s(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={id:n,exports:{}};return e[n].call(r.exports,r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nc=void 0,s(798)})(); \ No newline at end of file +(()=>{"use strict";var e={402:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(213),a=s.n(n),r=s(645),o=s.n(r)()(a());o.push([e.id,".shadowban-scanner-message {\n padding: 1em;\n border-radius: 0.5em;\n background: rgb(255, 0, 0, 0.2);\n margin: 1em 0;\n}\n\n.shadowban-scanner-message-no-problem {\n background: rgb(0, 255, 0, 0.2);\n}\n\n.shadowban-scanner-message button {\n cursor: pointer;\n color: inherit;\n border: none;\n background: none;\n}\n\n.shadowban-scanner-message pre {\n font-family: inherit;\n line-height: inherit;\n margin: 0.5rem 0 0 0;\n}\n",""]);const i=o},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var s="",n=void 0!==t[5];return t[4]&&(s+="@supports (".concat(t[4],") {")),t[2]&&(s+="@media ".concat(t[2]," {")),n&&(s+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),s+=e(t),n&&(s+="}"),t[2]&&(s+="}"),t[4]&&(s+="}"),s})).join("")},t.i=function(e,s,n,a,r){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(n)for(var i=0;i0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),s&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=s):l[2]=s),a&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=a):l[4]="".concat(a)),t.push(l))}},t}},213:e=>{e.exports=function(e){return e[1]}},962:(e,t,s)=>{s.r(t),s.d(t,{default:()=>b});var n=s(379),a=s.n(n),r=s(795),o=s.n(r),i=s(569),c=s.n(i),d=s(565),l=s.n(d),u=s(216),p=s.n(u),w=s(589),h=s.n(w),m=s(402),g={};g.styleTagTransform=h(),g.setAttributes=l(),g.insert=c().bind(null,"head"),g.domAPI=o(),g.insertStyleElement=p(),a()(m.Z,g);const b=m.Z&&m.Z.locals?m.Z.locals:void 0},379:e=>{var t=[];function s(e){for(var s=-1,n=0;n{var t={};e.exports=function(e,s){var n=function(e){if(void 0===t[e]){var s=document.querySelector(e);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(e){s=null}t[e]=s}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(s)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,s)=>{e.exports=function(e){var t=s.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(s){!function(e,t,s){var n="";s.supports&&(n+="@supports (".concat(s.supports,") {")),s.media&&(n+="@media ".concat(s.media," {"));var a=void 0!==s.layer;a&&(n+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),n+=s.css,a&&(n+="}"),s.media&&(n+="}"),s.supports&&(n+="}");var r=s.sourceMap;r&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,s)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},36:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Color=void 0,t.Color=class{constructor(){}get textColor(){const e=document.querySelector("[data-testid='User-Name'] div:first-child span, [data-testid='UserName'] div:first-child span");if(!e)throw new Error("Failed to get user name span of tweet");const{color:t}=getComputedStyle(e);return t}}},564:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Core=void 0;const n=s(296),a=s(915),r=s(338);s(962),t.Core=class{constructor(e){const t=new MutationObserver((()=>{const t=document.querySelectorAll(`[data-testid="tweet"]:not([${a.CHECKED_DATA_ATTRIBUTE}]`);for(const s of t)new r.TweetChecker(s).run(),e();const s=document.querySelector(`:not([data-testid="tweet"]) [data-testid="UserName"]:not([${a.CHECKED_DATA_ATTRIBUTE}])`);s&&(new n.ProfileChecker(s).run(),e())})),s=new MutationObserver((()=>{const e=document.querySelector("main");e&&(s.disconnect(),t.observe(e,{subtree:!0,childList:!0}))}));s.observe(document.body,{subtree:!0,childList:!0})}}},552:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageElement=void 0;const n=s(915);t.MessageElement=class{constructor(e,t,s){if(this.div=document.createElement("div"),this.div.classList.add(n.MESSAGE_CLASS_NAME),this.div.dataset.messageType=s,this.div.style.color=t,"tweet"===e){const e=document.createElement("pre");e.style.display="none",this.div.appendChild(e);const t=document.createElement("button");t.addEventListener("click",(()=>{e.style.display="block",t.remove()})),this.div.appendChild(t)}}set messageType(e){this.div.dataset.messageType=e}get element(){return this.div}}},531:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageType=void 0,t.MessageType=class{constructor(){}fromTweetStatus(e){return e.user.possiblySensitive||e.tweet.possiblySensitive?e.user.possiblySensitive?e.tweet.possiblySensitive?e.tweet.possiblySensitiveEditable?"accountShadowbannedAndTweetFlaggedAsSensitive":"accountAndTweetShadowbanned":"accountShadowbanned":e.tweet.possiblySensitiveEditable?"tweetFlaggedAsSensitive":"tweetShadowbanned":"tweetNoProblem"}}},296:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileChecker=void 0;const n=s(36),a=s(552),r=s(204),o=s(915);t.ProfileChecker=class{constructor(e){this.userName=e}run(){this.userName.setAttribute(o.CHECKED_DATA_ATTRIBUTE,"true");const e=new r.ProfileReactProps(this.userName).get();if(!Boolean(e.user.possibly_sensitive))return;const t=(new n.Color).textColor,s=new a.MessageElement("account",t,"accountShadowbanned"),i=document.querySelector("[data-testid='UserDescription']");if(!i)throw new Error("Failed to get user description of profile");i.insertAdjacentElement("afterend",s.element)}}},204:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileReactProps=t.TweetReactProps=void 0;class s{constructor(e){this.element=e,this.reactPropsName=Object.getOwnPropertyNames(e).filter((e=>e.startsWith("__reactProps$")))[0]}get(){return this.element[this.reactPropsName].children[1].props}}t.TweetReactProps=class{constructor(e){this.tweet=e}get(){return new s(this.tweet).get().retweetWithCommentLink.state.quotedStatus}},t.ProfileReactProps=class{constructor(e){this.userName=e}get(){return new s(this.userName).get()}}},338:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TweetChecker=void 0;const n=s(36),a=s(552),r=s(531),o=s(204),i=s(915);t.TweetChecker=class{constructor(e){this.tweet=e}run(){this.tweet.setAttribute(i.CHECKED_DATA_ATTRIBUTE,"true");const e=this.tweet.querySelector("div[role='group'][id]");if(!e)throw new Error("Failed to get menu bar of tweet");const t=new o.TweetReactProps(e).get(),s={tweet:{possiblySensitive:Boolean(t.possibly_sensitive),possiblySensitiveEditable:!(!1===t.possibly_sensitive_editable),isTweetByCurrentUser:null===t.user.following},user:{possiblySensitive:Boolean(t.user.possibly_sensitive)}},c=(new n.Color).textColor,d=new a.MessageElement("tweet",c);s.tweet.isTweetByCurrentUser&&d.element.classList.add(i.CURRENT_USERS_TWEET_CLASS_NAME);const l=(new r.MessageType).fromTweetStatus(s);d.messageType=l,"tweetNoProblem"===l&&d.element.classList.add("shadowban-scanner-message-no-problem"),e.insertAdjacentElement("beforebegin",d.element)}}},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SETTINGS=void 0,t.DEFAULT_SETTINGS={alwaysDetailedView:!1,showMessageInAllTweets:!1,enableOnlyForCurrentUsersTweets:!1}},915:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MESSAGE_CLASS_NAME=t.CURRENT_USERS_TWEET_CLASS_NAME=t.EVENT_GENERATOR_ID=t.CHECKED_DATA_ATTRIBUTE=void 0,t.CHECKED_DATA_ATTRIBUTE="data-shadowban-checked",t.EVENT_GENERATOR_ID="shadowban-scanner-event-generator",t.CURRENT_USERS_TWEET_CLASS_NAME="tweet-by-current-user",t.MESSAGE_CLASS_NAME="shadowban-scanner-message"},34:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFlow=void 0;const n=s(915);t.TextFlow=class{constructor(e){if(!e.showMessageInAllTweets){const e=document.createElement("style");e.textContent=".shadowban-scanner-message-no-problem { display: none; }",document.body.appendChild(e)}if(e.enableOnlyForCurrentUsersTweets){const e=document.createElement("style");e.textContent=`.${n.MESSAGE_CLASS_NAME}:not(.${n.CURRENT_USERS_TWEET_CLASS_NAME}) {display: none;}`,document.body.appendChild(e)}this.allWaysDetailedView=e.alwaysDetailedView,this.translator=e.translator}run(){const e=document.querySelector(".shadowban-scanner-message:not(.text-inserted");if(!e)return;e.classList.add("text-inserted");const{messageType:t}=e.dataset;if(!t)throw new Error("Failed to get message type");const s=this.translator(t);e.insertAdjacentText("afterbegin",s);const n=e.querySelector("button");if(!n)return;this.allWaysDetailedView?n.click():n.textContent=this.translator("showMore");const a=e.querySelector("pre");a&&(a.textContent=this.translator(`${t}StatusMessage`))}}},798:function(e,t,s){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(s(533));new(s(651).UserScriptBase)(a.default)},651:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UserScriptBase=void 0;const n=s(564),a=s(34),r=s(294);t.UserScriptBase=class{constructor(e){const t=Object.assign(Object.assign({},r.DEFAULT_SETTINGS),{translator:t=>e[t].message}),s=new a.TextFlow(t);new n.Core((()=>{s.run()}))}}},533:e=>{e.exports=JSON.parse('{"manifest_description":{"message":"A browser extension that detects shadowbans on Twitter."},"accountShadowbanned":{"message":"This user may be shadowbanned, so this tweet may not appear in search results."},"accountShadowbannedStatusMessage":{"message":"🚫Account may be shadowbanned.\\n✅Tweet is not flagged as sensitive.\\n✅Tweet has no age limit.\\n🚫Tweet may not appear in search results."},"accountShadowbannedAndTweetFlaggedAsSensitive":{"message":"This user may be shadowbanned so this tweet may not appear in search results. Also, this tweet is flagged as sensitive."},"accountShadowbannedAndTweetFlaggedAsSensitiveStatusMessage":{"message":"🚫Account may be shadowbanned.\\n🚫Tweet is flagged as sensitive.\\n✅Tweet has no age limit.\\n🚫Tweet may not appear in search results."},"accountAndTweetShadowbanned":{"message":"This tweet is age-restricted and cannot be viewed by users under the age of 18 or who are not logged in. This tweet may not appear in search results."},"accountAndTweetShadowbannedStatusMessage":{"message":"🚫Account may be shadowbanned.\\n🚫Tweet is flagged as sensitive.\\n🚫Tweet has age limit.\\n🚫Tweet may not appear in search results."},"tweetFlaggedAsSensitive":{"message":"This tweet is flagged as sensitive and will not appear in search results depending on the viewer\'s preferences."},"tweetFlaggedAsSensitiveStatusMessage":{"message":"✅Account is not shadowbanned.\\n🚫Tweet is flagged as sensitive.\\n✅Tweet has no age limit.\\n⚠️Tweet may not appear in search results depending on viewer preferences."},"tweetShadowbanned":{"message":"This tweet is age-restricted and cannot be viewed by users under the age of 18 or who are not logged in. This tweet may not appear in search results."},"tweetShadowbannedStatusMessage":{"message":"✅Account is not shadowbanned.\\n🚫Tweet is flagged as sensitive.\\n🚫Tweet has age limit.\\n🚫Tweet may not appear in search results."},"tweetNoProblem":{"message":"No problems was found with this tweet."},"tweetNoProblemStatusMessage":{"message":"✅Account is not shadowbanned.\\n✅Tweet is not flagged as sensitive.\\n✅Tweet has no age limit.\\n✅Tweet will appear in search results."},"showMore":{"message":"▶show more"},"settingsAlwaysDetailedView":{"message":"Always display detailed information"},"settingsShowMessageInAllTweets":{"message":"Show check results in all tweets"},"settingsEnableOnlyForCurrentUsersTweets":{"message":"Display check results only in your own tweets (beta)"},"settingsPleaseReload":{"message":"Please reload Twitter once you have changed the settings."}}')}},t={};function s(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={id:n,exports:{}};return e[n].call(r.exports,r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nc=void 0,s(798)})(); \ No newline at end of file diff --git a/userScript/ja.user.js b/userScript/ja.user.js index d4527b99..446e5292 100644 --- a/userScript/ja.user.js +++ b/userScript/ja.user.js @@ -13,4 +13,4 @@ // @grant none // ==/UserScript== -(()=>{"use strict";var e={402:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(213),r=n.n(s),o=n(645),a=n.n(o)()(r());a.push([e.id,".shadowban-scanner-message {\n padding: 1em;\n border-radius: 0.5em;\n background: rgb(255, 0, 0, 0.2);\n margin: 1em 0;\n}\n\n.shadowban-scanner-message-no-problem {\n background: rgb(0, 255, 0, 0.2);\n}\n\n.shadowban-scanner-message button {\n cursor: pointer;\n color: inherit;\n border: none;\n background: none;\n}\n\n.shadowban-scanner-message pre {\n font-family: inherit;\n line-height: inherit;\n margin: 0.5rem 0 0 0;\n}\n",""]);const i=a},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",s=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),s&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),s&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,s,r,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(s)for(var i=0;i0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=o),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),r&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=r):l[4]="".concat(r)),t.push(l))}},t}},213:e=>{e.exports=function(e){return e[1]}},962:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var s=n(379),r=n.n(s),o=n(795),a=n.n(o),i=n(569),c=n.n(i),d=n(565),l=n.n(d),u=n(216),p=n.n(u),m=n(589),w=n.n(m),f=n(402),g={};g.styleTagTransform=w(),g.setAttributes=l(),g.insert=c().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=p(),r()(f.Z,g);const h=f.Z&&f.Z.locals?f.Z.locals:void 0},379:e=>{var t=[];function n(e){for(var n=-1,s=0;s{var t={};e.exports=function(e,n){var s=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(n)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var s="";n.supports&&(s+="@supports (".concat(n.supports,") {")),n.media&&(s+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(s+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),s+=n.css,r&&(s+="}"),n.media&&(s+="}"),n.supports&&(s+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(s,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},36:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Color=void 0,t.Color=class{constructor(){}get textColor(){const e=document.querySelector("[data-testid='User-Name'] div:first-child span, [data-testid='UserName'] div:first-child span");if(!e)throw new Error("Failed to get user name span of tweet");const{color:t}=getComputedStyle(e);return t}}},564:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Core=void 0;const s=n(296),r=n(915),o=n(338);n(962),t.Core=class{constructor(e){const t=new MutationObserver((()=>{const t=document.querySelectorAll(`[data-testid="tweet"]:not([${r.CHECKED_DATA_ATTRIBUTE}]`);for(const n of t)new o.TweetChecker(n).run(),e();const n=document.querySelector(`:not([data-testid="tweet"]) [data-testid="UserName"]:not([${r.CHECKED_DATA_ATTRIBUTE}])`);n&&(new s.ProfileChecker(n).run(),e())})),n=new MutationObserver((()=>{const e=document.querySelector("main");e&&(n.disconnect(),t.observe(e,{subtree:!0,childList:!0}))}));n.observe(document.body,{subtree:!0,childList:!0})}}},552:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageElement=void 0;const s=n(915);t.MessageElement=class{constructor(e,t,n){if(this.div=document.createElement("div"),this.div.classList.add(s.MESSAGE_CLASS_NAME),this.div.dataset.messageType=n,this.div.style.color=t,"tweet"===e){const e=document.createElement("pre");e.style.display="none",this.div.appendChild(e);const t=document.createElement("button");t.addEventListener("click",(()=>{e.style.display="block",t.remove()})),this.div.appendChild(t)}}set messageType(e){this.div.dataset.messageType=e}get element(){return this.div}}},531:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageType=void 0,t.MessageType=class{constructor(){}fromTweetStatus(e){return e.user.possiblySensitive||e.tweet.possiblySensitive?e.user.possiblySensitive?e.tweet.possiblySensitive?e.tweet.possiblySensitiveEditable?"accountShadowbannedAndTweetFlaggedAsSensitive":"accountAndTweetShadowbanned":"accountShadowbanned":e.tweet.possiblySensitiveEditable?"tweetFlaggedAsSensitive":"tweetShadowbanned":"tweetNoProblem"}}},296:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileChecker=void 0;const s=n(36),r=n(552),o=n(204),a=n(915);t.ProfileChecker=class{constructor(e){this.userName=e}run(){this.userName.setAttribute(a.CHECKED_DATA_ATTRIBUTE,"true");const e=new o.ProfileReactProps(this.userName).get();if(!Boolean(e.user.possibly_sensitive))return;const t=(new s.Color).textColor,n=new r.MessageElement("account",t,"accountShadowbanned"),i=document.querySelector("[data-testid='UserDescription']");if(!i)throw new Error("Failed to get user description of profile");i.insertAdjacentElement("afterend",n.element)}}},204:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileReactProps=t.TweetReactProps=void 0;class n{constructor(e){this.element=e,this.reactPropsName=Object.getOwnPropertyNames(e).filter((e=>e.startsWith("__reactProps$")))[0]}get(){return this.element[this.reactPropsName].children[1].props}}t.TweetReactProps=class{constructor(e){this.tweet=e}get(){return new n(this.tweet).get().retweetWithCommentLink.state.quotedStatus}},t.ProfileReactProps=class{constructor(e){this.userName=e}get(){return new n(this.userName).get()}}},338:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TweetChecker=void 0;const s=n(36),r=n(552),o=n(531),a=n(204),i=n(915);t.TweetChecker=class{constructor(e){this.tweet=e}run(){this.tweet.setAttribute(i.CHECKED_DATA_ATTRIBUTE,"true");const e=this.tweet.querySelector("div[role='group'][id]");if(!e)throw new Error("Failed to get menu bar of tweet");const t=new a.TweetReactProps(e).get(),n={tweet:{possiblySensitive:t.possibly_sensitive,possiblySensitiveEditable:t.possibly_sensitive_editable,isTweetByCurrentUser:null===t.user.following},user:{possiblySensitive:t.user.possibly_sensitive}},c=(new s.Color).textColor,d=new r.MessageElement("tweet",c);n.tweet.isTweetByCurrentUser&&d.element.classList.add(i.CURRENT_USERS_TWEET_CLASS_NAME);const l=(new o.MessageType).fromTweetStatus(n);d.messageType=l,"tweetNoProblem"===l&&d.element.classList.add("shadowban-scanner-message-no-problem"),e.insertAdjacentElement("beforebegin",d.element)}}},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SETTINGS=void 0,t.DEFAULT_SETTINGS={alwaysDetailedView:!1,showMessageInAllTweets:!1,enableOnlyForCurrentUsersTweets:!1}},915:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MESSAGE_CLASS_NAME=t.CURRENT_USERS_TWEET_CLASS_NAME=t.EVENT_GENERATOR_ID=t.CHECKED_DATA_ATTRIBUTE=void 0,t.CHECKED_DATA_ATTRIBUTE="data-shadowban-checked",t.EVENT_GENERATOR_ID="shadowban-scanner-event-generator",t.CURRENT_USERS_TWEET_CLASS_NAME="tweet-by-current-user",t.MESSAGE_CLASS_NAME="shadowban-scanner-message"},34:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFlow=void 0;const s=n(915);t.TextFlow=class{constructor(e){if(!e.showMessageInAllTweets){const e=document.createElement("style");e.textContent=".shadowban-scanner-message-no-problem { display: none; }",document.body.appendChild(e)}if(e.enableOnlyForCurrentUsersTweets){const e=document.createElement("style");e.textContent=`.${s.MESSAGE_CLASS_NAME}:not(.${s.CURRENT_USERS_TWEET_CLASS_NAME}) {display: none;}`,document.body.appendChild(e)}this.allWaysDetailedView=e.alwaysDetailedView,this.translator=e.translator}run(){const e=document.querySelector(".shadowban-scanner-message:not(.text-inserted");if(!e)return;e.classList.add("text-inserted");const{messageType:t}=e.dataset;if(!t)throw new Error("Failed to get message type");const n=this.translator(t);e.insertAdjacentText("afterbegin",n);const s=e.querySelector("button");if(!s)return;this.allWaysDetailedView?s.click():s.textContent=this.translator("showMore");const r=e.querySelector("pre");r&&(r.textContent=this.translator(`${t}StatusMessage`))}}},978:function(e,t,n){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=s(n(481));new(n(651).UserScriptBase)(r.default)},651:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UserScriptBase=void 0;const s=n(564),r=n(34),o=n(294);t.UserScriptBase=class{constructor(e){const t=Object.assign(Object.assign({},o.DEFAULT_SETTINGS),{translator:t=>e[t].message}),n=new r.TextFlow(t);new s.Core((()=>{n.run()}))}}},481:e=>{e.exports=JSON.parse('{"manifest_description":{"message":"Twitterのシャドウバンを検出する拡張機能です。"},"accountShadowbanned":{"message":"このユーザーはシャドウバンされている可能性があるため、ツイートが検索結果に表示されないかもしれません。"},"accountShadowbannedStatusMessage":{"message":"🚫アカウントがシャドウバンされている可能性があります\\n✅ツイートにセンシティブフラグは付与されていません\\n✅ツイートに年齢制限はありません\\n🚫ツイートが検索結果に表示されない可能性があります"},"accountShadowbannedAndTweetFlaggedAsSensitive":{"message":"このユーザーはシャドウバンされている可能性があるため、ツイートが検索結果に表示されないかもしれません。また、このツイートにはセンシティブフラグが付与されています。"},"accountShadowbannedAndTweetFlaggedAsSensitiveStatusMessage":{"message":"🚫アカウントがシャドウバンされている可能性があります\\n🚫ツイートにセンシティブフラグが付与されています\\n✅ツイートに年齢制限はありません\\n🚫ツイートが検索結果に表示されない可能性があります"},"accountAndTweetShadowbanned":{"message":"このツイートには年齢制限があり、18歳未満のユーザーやログインしていないユーザーは閲覧できません。また、検索結果に表示されない可能性があります。"},"accountAndTweetShadowbannedStatusMessage":{"message":"🚫アカウントがシャドウバンされている可能性があります\\n🚫ツイートにセンシティブフラグが付与されています\\n🚫ツイートに年齢制限があります\\n🚫ツイートが検索結果に表示されない可能性があります"},"tweetFlaggedAsSensitive":{"message":"このツイートにはセンシティブフラグが付与されており、閲覧者の設定によっては検索結果に表示されません。"},"tweetFlaggedAsSensitiveStatusMessage":{"message":"✅アカウントはシャドウバンされていません\\n🚫ツイートにセンシティブフラグが付与されています\\n✅ツイートに年齢制限はありません\\n⚠️ツイートは閲覧者の設定によっては検索結果に表示されません"},"tweetShadowbanned":{"message":"このツイートには年齢制限があり、18歳未満のユーザーやログインしていないユーザーは閲覧できません。また、検索結果に表示されない可能性があります。"},"tweetShadowbannedStatusMessage":{"message":"✅アカウントはシャドウバンされていません\\n🚫ツイートにセンシティブフラグが付与されています\\n🚫ツイートに年齢制限があります\\n🚫ツイートが検索結果に表示されない可能性があります"},"tweetNoProblem":{"message":"ツイートに問題は見つかりませんでした。"},"tweetNoProblemStatusMessage":{"message":"✅アカウントはシャドウバンされていません\\n✅ツイートにセンシティブフラグは付与されていません\\n✅ツイートに年齢制限はありません\\n✅ツイートは検索結果に表示されます"},"showMore":{"message":"▶さらに表示"},"settingsAlwaysDetailedView":{"message":"常に詳細情報を表示する"},"settingsShowMessageInAllTweets":{"message":"すべてのツイートに検証結果を表示する"},"settingsEnableOnlyForCurrentUsersTweets":{"message":"自分のツイートにのみ検証結果を表示する(ベータ版)"},"settingsPleaseReload":{"message":"設定を変更したらTwitterを再読み込みしてください。"}}')}},t={};function n(s){var r=t[s];if(void 0!==r)return r.exports;var o=t[s]={id:s,exports:{}};return e[s].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,n(978)})(); \ No newline at end of file +(()=>{"use strict";var e={402:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(213),r=n.n(s),o=n(645),a=n.n(o)()(r());a.push([e.id,".shadowban-scanner-message {\n padding: 1em;\n border-radius: 0.5em;\n background: rgb(255, 0, 0, 0.2);\n margin: 1em 0;\n}\n\n.shadowban-scanner-message-no-problem {\n background: rgb(0, 255, 0, 0.2);\n}\n\n.shadowban-scanner-message button {\n cursor: pointer;\n color: inherit;\n border: none;\n background: none;\n}\n\n.shadowban-scanner-message pre {\n font-family: inherit;\n line-height: inherit;\n margin: 0.5rem 0 0 0;\n}\n",""]);const i=a},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",s=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),s&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),s&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,s,r,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(s)for(var i=0;i0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=o),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),r&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=r):l[4]="".concat(r)),t.push(l))}},t}},213:e=>{e.exports=function(e){return e[1]}},962:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var s=n(379),r=n.n(s),o=n(795),a=n.n(o),i=n(569),c=n.n(i),d=n(565),l=n.n(d),u=n(216),p=n.n(u),m=n(589),w=n.n(m),f=n(402),g={};g.styleTagTransform=w(),g.setAttributes=l(),g.insert=c().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=p(),r()(f.Z,g);const h=f.Z&&f.Z.locals?f.Z.locals:void 0},379:e=>{var t=[];function n(e){for(var n=-1,s=0;s{var t={};e.exports=function(e,n){var s=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(n)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var s="";n.supports&&(s+="@supports (".concat(n.supports,") {")),n.media&&(s+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(s+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),s+=n.css,r&&(s+="}"),n.media&&(s+="}"),n.supports&&(s+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(s,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},36:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Color=void 0,t.Color=class{constructor(){}get textColor(){const e=document.querySelector("[data-testid='User-Name'] div:first-child span, [data-testid='UserName'] div:first-child span");if(!e)throw new Error("Failed to get user name span of tweet");const{color:t}=getComputedStyle(e);return t}}},564:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Core=void 0;const s=n(296),r=n(915),o=n(338);n(962),t.Core=class{constructor(e){const t=new MutationObserver((()=>{const t=document.querySelectorAll(`[data-testid="tweet"]:not([${r.CHECKED_DATA_ATTRIBUTE}]`);for(const n of t)new o.TweetChecker(n).run(),e();const n=document.querySelector(`:not([data-testid="tweet"]) [data-testid="UserName"]:not([${r.CHECKED_DATA_ATTRIBUTE}])`);n&&(new s.ProfileChecker(n).run(),e())})),n=new MutationObserver((()=>{const e=document.querySelector("main");e&&(n.disconnect(),t.observe(e,{subtree:!0,childList:!0}))}));n.observe(document.body,{subtree:!0,childList:!0})}}},552:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageElement=void 0;const s=n(915);t.MessageElement=class{constructor(e,t,n){if(this.div=document.createElement("div"),this.div.classList.add(s.MESSAGE_CLASS_NAME),this.div.dataset.messageType=n,this.div.style.color=t,"tweet"===e){const e=document.createElement("pre");e.style.display="none",this.div.appendChild(e);const t=document.createElement("button");t.addEventListener("click",(()=>{e.style.display="block",t.remove()})),this.div.appendChild(t)}}set messageType(e){this.div.dataset.messageType=e}get element(){return this.div}}},531:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageType=void 0,t.MessageType=class{constructor(){}fromTweetStatus(e){return e.user.possiblySensitive||e.tweet.possiblySensitive?e.user.possiblySensitive?e.tweet.possiblySensitive?e.tweet.possiblySensitiveEditable?"accountShadowbannedAndTweetFlaggedAsSensitive":"accountAndTweetShadowbanned":"accountShadowbanned":e.tweet.possiblySensitiveEditable?"tweetFlaggedAsSensitive":"tweetShadowbanned":"tweetNoProblem"}}},296:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileChecker=void 0;const s=n(36),r=n(552),o=n(204),a=n(915);t.ProfileChecker=class{constructor(e){this.userName=e}run(){this.userName.setAttribute(a.CHECKED_DATA_ATTRIBUTE,"true");const e=new o.ProfileReactProps(this.userName).get();if(!Boolean(e.user.possibly_sensitive))return;const t=(new s.Color).textColor,n=new r.MessageElement("account",t,"accountShadowbanned"),i=document.querySelector("[data-testid='UserDescription']");if(!i)throw new Error("Failed to get user description of profile");i.insertAdjacentElement("afterend",n.element)}}},204:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileReactProps=t.TweetReactProps=void 0;class n{constructor(e){this.element=e,this.reactPropsName=Object.getOwnPropertyNames(e).filter((e=>e.startsWith("__reactProps$")))[0]}get(){return this.element[this.reactPropsName].children[1].props}}t.TweetReactProps=class{constructor(e){this.tweet=e}get(){return new n(this.tweet).get().retweetWithCommentLink.state.quotedStatus}},t.ProfileReactProps=class{constructor(e){this.userName=e}get(){return new n(this.userName).get()}}},338:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TweetChecker=void 0;const s=n(36),r=n(552),o=n(531),a=n(204),i=n(915);t.TweetChecker=class{constructor(e){this.tweet=e}run(){this.tweet.setAttribute(i.CHECKED_DATA_ATTRIBUTE,"true");const e=this.tweet.querySelector("div[role='group'][id]");if(!e)throw new Error("Failed to get menu bar of tweet");const t=new a.TweetReactProps(e).get(),n={tweet:{possiblySensitive:Boolean(t.possibly_sensitive),possiblySensitiveEditable:!(!1===t.possibly_sensitive_editable),isTweetByCurrentUser:null===t.user.following},user:{possiblySensitive:Boolean(t.user.possibly_sensitive)}},c=(new s.Color).textColor,d=new r.MessageElement("tweet",c);n.tweet.isTweetByCurrentUser&&d.element.classList.add(i.CURRENT_USERS_TWEET_CLASS_NAME);const l=(new o.MessageType).fromTweetStatus(n);d.messageType=l,"tweetNoProblem"===l&&d.element.classList.add("shadowban-scanner-message-no-problem"),e.insertAdjacentElement("beforebegin",d.element)}}},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SETTINGS=void 0,t.DEFAULT_SETTINGS={alwaysDetailedView:!1,showMessageInAllTweets:!1,enableOnlyForCurrentUsersTweets:!1}},915:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MESSAGE_CLASS_NAME=t.CURRENT_USERS_TWEET_CLASS_NAME=t.EVENT_GENERATOR_ID=t.CHECKED_DATA_ATTRIBUTE=void 0,t.CHECKED_DATA_ATTRIBUTE="data-shadowban-checked",t.EVENT_GENERATOR_ID="shadowban-scanner-event-generator",t.CURRENT_USERS_TWEET_CLASS_NAME="tweet-by-current-user",t.MESSAGE_CLASS_NAME="shadowban-scanner-message"},34:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFlow=void 0;const s=n(915);t.TextFlow=class{constructor(e){if(!e.showMessageInAllTweets){const e=document.createElement("style");e.textContent=".shadowban-scanner-message-no-problem { display: none; }",document.body.appendChild(e)}if(e.enableOnlyForCurrentUsersTweets){const e=document.createElement("style");e.textContent=`.${s.MESSAGE_CLASS_NAME}:not(.${s.CURRENT_USERS_TWEET_CLASS_NAME}) {display: none;}`,document.body.appendChild(e)}this.allWaysDetailedView=e.alwaysDetailedView,this.translator=e.translator}run(){const e=document.querySelector(".shadowban-scanner-message:not(.text-inserted");if(!e)return;e.classList.add("text-inserted");const{messageType:t}=e.dataset;if(!t)throw new Error("Failed to get message type");const n=this.translator(t);e.insertAdjacentText("afterbegin",n);const s=e.querySelector("button");if(!s)return;this.allWaysDetailedView?s.click():s.textContent=this.translator("showMore");const r=e.querySelector("pre");r&&(r.textContent=this.translator(`${t}StatusMessage`))}}},978:function(e,t,n){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=s(n(481));new(n(651).UserScriptBase)(r.default)},651:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UserScriptBase=void 0;const s=n(564),r=n(34),o=n(294);t.UserScriptBase=class{constructor(e){const t=Object.assign(Object.assign({},o.DEFAULT_SETTINGS),{translator:t=>e[t].message}),n=new r.TextFlow(t);new s.Core((()=>{n.run()}))}}},481:e=>{e.exports=JSON.parse('{"manifest_description":{"message":"Twitterのシャドウバンを検出する拡張機能です。"},"accountShadowbanned":{"message":"このユーザーはシャドウバンされている可能性があるため、ツイートが検索結果に表示されないかもしれません。"},"accountShadowbannedStatusMessage":{"message":"🚫アカウントがシャドウバンされている可能性があります\\n✅ツイートにセンシティブフラグは付与されていません\\n✅ツイートに年齢制限はありません\\n🚫ツイートが検索結果に表示されない可能性があります"},"accountShadowbannedAndTweetFlaggedAsSensitive":{"message":"このユーザーはシャドウバンされている可能性があるため、ツイートが検索結果に表示されないかもしれません。また、このツイートにはセンシティブフラグが付与されています。"},"accountShadowbannedAndTweetFlaggedAsSensitiveStatusMessage":{"message":"🚫アカウントがシャドウバンされている可能性があります\\n🚫ツイートにセンシティブフラグが付与されています\\n✅ツイートに年齢制限はありません\\n🚫ツイートが検索結果に表示されない可能性があります"},"accountAndTweetShadowbanned":{"message":"このツイートには年齢制限があり、18歳未満のユーザーやログインしていないユーザーは閲覧できません。また、検索結果に表示されない可能性があります。"},"accountAndTweetShadowbannedStatusMessage":{"message":"🚫アカウントがシャドウバンされている可能性があります\\n🚫ツイートにセンシティブフラグが付与されています\\n🚫ツイートに年齢制限があります\\n🚫ツイートが検索結果に表示されない可能性があります"},"tweetFlaggedAsSensitive":{"message":"このツイートにはセンシティブフラグが付与されており、閲覧者の設定によっては検索結果に表示されません。"},"tweetFlaggedAsSensitiveStatusMessage":{"message":"✅アカウントはシャドウバンされていません\\n🚫ツイートにセンシティブフラグが付与されています\\n✅ツイートに年齢制限はありません\\n⚠️ツイートは閲覧者の設定によっては検索結果に表示されません"},"tweetShadowbanned":{"message":"このツイートには年齢制限があり、18歳未満のユーザーやログインしていないユーザーは閲覧できません。また、検索結果に表示されない可能性があります。"},"tweetShadowbannedStatusMessage":{"message":"✅アカウントはシャドウバンされていません\\n🚫ツイートにセンシティブフラグが付与されています\\n🚫ツイートに年齢制限があります\\n🚫ツイートが検索結果に表示されない可能性があります"},"tweetNoProblem":{"message":"ツイートに問題は見つかりませんでした。"},"tweetNoProblemStatusMessage":{"message":"✅アカウントはシャドウバンされていません\\n✅ツイートにセンシティブフラグは付与されていません\\n✅ツイートに年齢制限はありません\\n✅ツイートは検索結果に表示されます"},"showMore":{"message":"▶さらに表示"},"settingsAlwaysDetailedView":{"message":"常に詳細情報を表示する"},"settingsShowMessageInAllTweets":{"message":"すべてのツイートに検証結果を表示する"},"settingsEnableOnlyForCurrentUsersTweets":{"message":"自分のツイートにのみ検証結果を表示する(ベータ版)"},"settingsPleaseReload":{"message":"設定を変更したらTwitterを再読み込みしてください。"}}')}},t={};function n(s){var r=t[s];if(void 0!==r)return r.exports;var o=t[s]={id:s,exports:{}};return e[s].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,n(978)})(); \ No newline at end of file