Twitter 主頁面上的媒體模式
Github: https://github.com/UtopicPanther/userscript-twitter-home-media
在我的 Twitter 主頁和列表上刪除純文字的 Tweet。
指令碼需要一定的時間才能啟動。
警告:不存在完全準確的方式探測 Tweet 是否包含圖片和其他媒體。此指令碼進行了大量冗餘處理,出現誤刪除 Tweet 的情況應該是相當罕見的。但仍然可能出現誤刪除的情況,如果不能接受,請勿使用此指令碼。
工作原理:監聽頁面元素變動。然後檢索不包含圖片和其他媒體(如視訊)的全部 Tweet,將它們隱藏。
我僅在 Firefox (禁用 CSP)和 Violentmonkey 環境下測試。使用者報告也在 Chrome 下工作。
Firefox 注意事項
由於 CSP 限制,你可能需要在新版 Firefox 高階首選項 about:config
中將 security.csp.enable
設定為 false
COPYING
Copyright (C) 2020 UtopicPanther
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see https://www.gnu.org/licenses/.
This script contains an additional exemption. When this script is
injected into the site with the original setting of @match
,
other user scripts running in the same space are not required to
be compatible with GPL 3.
這個指令碼包含一個附加豁免。當此指令碼被注入到原有設定 @match
的
站點時,不要求同一空間中執行的其他使用者指令碼與 GPL 3 相容。