在桌機上擋 Facebook 各種廣告與演算法推薦文章的 userscript

發現好像沒提過這個 userscript,由於 uBlock Origin 的條件式不足以擋 Facebook 的各種廣告機制,目前需要靠 userscript 擋:「FB - Clean my feeds」。

預設會擋掉 sponsored,像是這樣:

不過在點開左下角的 icon 後,可以看到更多選項可以擋,我是把所有列出來的都勾起來了,另外多增加一個 「Interested」(我這邊用的是英文版介面的 Facebook,看到的是 Interested 這個詞):

然後經過幾次 Facebook 反制的「改版」,作者也都蠻快就更新...

歐盟決定將挪威對 Meta 的禁令擴大到整個歐盟

挪威一開始禁止 Meta 旗下的產品 (也就包括了 FacebookInstagram) 透過蒐集使用者的行為投放廣告 (behavioural advertising):「Norway court rules against Facebook owner Meta in privacy case」。

接著是挪威跟歐盟提議一起跟上 (挪威不是歐盟成員):「Norway asks EU regulator to fine Facebook owner Meta over privacy breach」。

接著就是現在了,歐盟也決定跟上:「Facebook owner Meta faces EU ban on targeted advertising」。

這樣比起單獨一個挪威的禁令強多了,而且 Meta 被打下去了,隔壁棚的 GoogleTikTok 應該也有機會接著掃蕩?

擋 YouTube 短影音的設定

短影音類的影片因為沒有知識量 (沒有 reference 可以確認正確性),我完全不會看... 但 YouTube 上一般的影音我會翻,所以就會冒出這個需求了。

YouTube 的短影音有幾個地方會出現 (補充一下,我這邊是用英文版介面):

  • 首頁的左邊,會有一個 Shorts 的連結可以點進 Shorts 看。
  • 首頁的推薦裡面也會有 Shorts 的 section。

這兩個情況用這兩條擋:

www.youtube.com##a[title="Shorts"]
www.youtube.com##ytd-rich-section-renderer

這邊要注意的是,後者除了擋掉 Shorts 以外,還會擋掉各種 YouTube 的推銷 (像是電影之類的),這個也是我要擋的,所以我這邊直接用了 ytd-rich-section-renderer 這個元素來擋。

再來是各種穿插在頁面裡面的 Shorts 內容,像是首頁、訂閱頁與搜尋結果頁,這些就要找出對應的元素來擋:

www.youtube.com##ytd-reel-shelf-renderer
www.youtube.com##ytd-video-renderer:has(a[href*="/shorts/"])

另外一個跟短影音無關,但還是很影響專注度的是,YouTube 的搜尋結果會給你一堆很干擾結果的推薦,像是「People also watched」、「For you」、「Previously watched」以及「From related searches」,也可以設定擋掉:

www.youtube.com##:matches-path(/results) ytd-shelf-renderer[thumbnail-style]

目前用的差不多是這些...

最近 YouTube 在阻擋擋廣告軟體的事情

最近用 uBlock Origin 或是其他擋廣告軟體的都加減會遇到 YouTube 阻擋擋廣告軟體的事情,然後在 HN 上面看到「Youtube’s Anti-adblock and uBlock Origin」,對應的討論在「YouTube's Anti-Adblock and uBlock Origin (andadinosaur.com)」這邊。

先說一下目前的解法可以參考「YouTube Anti-Adblock and Ads - October 16, 2023 (Weekly Thread)」這篇說明,目前的建議就是每天睡醒後更新一下清單 (block list),讓清單是最新的。

這邊的清單不需要全部更新,只需要針對「uBlock filters – Quick fixes」這組就可以了,方法是點一下他的時鐘部分,然後再按上面的 Update Now 更新就可以了 (我是英文版介面,中文版的話應該是中文的...):

基本上就是個貓抓老鼠的過程,最近更新的會很頻繁。

另外一個最近開始用,也很推薦的套件「SponsorBlock for YouTube - Skip Sponsorships」,可以跳過業配片段。

uBlock Origin 1.48.0 的改善

Hacker News 上看到「uBlock Origin 1.48 adds readiness status, code viewer, and other fixes (github.com/gorhill)」這則消息,uBlock Origin 在 1.48 有個蠻重要的 UI/UX 改善 (Readiness status at browser launch)。

uBlock Origin 預設會搭配「工人智慧」維護的列表,這些列表通常都不小,在剛開瀏覽器,還在讀取的過程中去看網站會遇到阻擋不完整的情況。

先前沒有辦法知道這個問題,在這版加上了對應的 icon color 來解決,黃色表示還在讀:

這時候跑去逛網站的話會出現驚嘆號:

讀取完後 icon 會變成標準的紅色,但驚嘆號仍然會留著,表示這個頁面未必有完整過濾:

正常有阻擋的則是這樣:

理論上可以減少 bug report XDDD

To reduce the number of reports caused by this issue which is outside of uBO's control, uBO's toolbar icon will now reflect its readiness status at browser launch.

FBI 建議用擋廣告軟體降低瀏覽時的風險

在「Even the FBI says you should use an ad blocker」這邊看到的新聞,FBI 的公告則是在「Cyber Criminals Impersonating Brands Using Search Engine Advertisement Services to Defraud Users」這邊可以看到。

起因是有很多網路犯罪行為會透過購買廣告,在搜尋引擎上曝光誘導使用者點擊:

Cyber criminals purchase advertisements that appear within internet search results using a domain that is similar to an actual business or service. When a user searches for that business or service, these advertisements appear at the very top of search results with minimum distinction between an advertisement and an actual search result. These advertisements link to a webpage that looks identical to the impersonated business’s official webpage.

其中一種方式是,使用者輸入關鍵字想要下載某些特定的軟體,這時候網路犯罪者就會透過下廣告的方式,誘導使用者到假的網站下載有後門木馬的軟體:

In instances where a user is searching for a program to download, the fraudulent webpage has a link to download software that is actually malware. The download page looks legitimate and the download itself is named after the program the user intended to download.

這個方式讓我想到之前北韓政府對 PuTTY 的攻擊:「Trojanized versions of PuTTY utility being used to spread backdoor」。

而 FBI 建議個人的保護方式包括了 ad blocking extension,這算是減少被攻擊的管道:

Use an ad blocking extension when performing internet searches. Most internet browsers allow a user to add extensions, including extensions that block advertisements. These ad blockers can be turned on and off within a browser to permit advertisements on certain websites while blocking advertisements on others.

然後建議擋廣告軟體就是用 uBlock Origin,無論是 Chromium 系列的瀏覽器 (包括 Google Chrome),或是 Firefox 都有支援。

自己從頭搞整套 Pi-hole 方案 (DNS 阻擋廣告的方案)

如果不用 Pi-hole 這種套件的話,從頭自己搞差不多就是這樣:「Ads blocking with OpenBSD unbound(8)」。

作者除了阻擋的必要功能部份以外,還把 log 導出來丟進 InfluxDB,透過 Grafana 可以看狀態,這類似於 Pi-hole 提供的方案:

Grafana to render the statistics ;
InfluxDB to store the information ;
syslogd(8) and awk(1) to turn DNS queries into statistics ;
collectd(1) and shell script to store unbound statistics and logs ;
unbound(8) and shell script to get and block DNS queries.

對應的 diagram 長這樣 (但為什麼作者要用 comic sans 呢...):

瀏覽器可以用 uBlock Origin 這類方案來做,可以擋的更細緻,而手機 app 一般就只能靠這種方法過濾掉部份的廣告。

如果想要擋更多的話 (像是只擋某個 url,而不是整個 domain),得用自建的 root CA 加上 MITM 的方式攔 HTTPS 連線,這通常都是在手機上面跑 virtual VPN,像是 iOS 上的 Surge 5 或是 Quantumult X

uBO Lite:另外一個方向的嘗試

兩個禮拜前在 Hacker News 上看到的東西,算是 uBlock OriginManifest V3 (MV3) 的另外一種嘗試:「uBlock Origin Lite: Description (github.com/gorhill)」,專案的說明在「uBO Lite (uBOL), an experimental permission-less MV3 API-based content blocker.」這邊。

先前在「因應 Manifest V3 而推出的 uBlock Minus (MV3)」這邊提到的 uBlock Minus 是在 MV3 環境下的一個嘗試,但這個版本只是把 MV3 做不到的事情先拔掉,所以缺了很多重要的功能,像是 cosmetic filtering (主要是針對瀏覽器不支援的 css selector,像是最近才剛支援的 :has(),而這些 css selector 對於選擇要幹掉的 html 元素很好用)。

uBO Lite 則是一個妥協,另外讓使用者對特定站台點選授權,而在這些特定授權的站台可以恢復到原來 MV2 時可以過濾的能力 (包含 cosmetic filtering 等等的能力):

但這個方案也是 Google 所樂見的,只要不方便就會讓使用者慢慢放棄。

目前的公告提到 MV2 只支援到明年一月,大概還有三四個月的時間,接下來 adblock 這塊應該會有很多新的方法陸陸續續冒出來...

因應 Manifest V3 而推出的 uBlock Minus (MV3)

前幾天在 Hacker News 上看到「“UBO Minus (MV3)” – An Experimental uBlock Origin Build for Manifest V3 (github.com/gorhill)」這個,裡面是 uBlock Origin 的作者 Raymond Hill 針對 Manifest V3 的半殘版,取名為 uBO Minus (MV3):「Add experimental mv3 version」。

在這個版本裡會有不少的功能失效,尤其是用的很多的 cosmetic filtering:

- No cosmetic filtering (##)
- No scriptlet injection (##+js)
- No redirect= filters
- No csp= filters
- No removeparam= filters

這個版本應該是打算要提供給 Manifest V2 被 Google 廢掉後還在用 Google 控制的瀏覽器的人,依照「Manifest V2 support timeline」這邊看起來是明年一月:

Banner blindness

前幾天的 Hacker News Daily 上看到「Why do people not notice our enormous, prominent, clear and contrasting purple banner?」這篇 2018 年的討論,裡面在講為什麼使用者會常態性忽略 banner 的內容。

在答覆區裡面有人提到了維基百科上面的 Banner blindness 這個條目,題到了網站的使用者會刻意或是非刻意的忽略掉像 banner 的資訊:

Banner blindness is a phenomenon in web usability where visitors to a website consciously or unconsciously ignore banner-like information. A broader term covering all forms of advertising is ad blindness, and the mass of banners that people ignore is called banner noise.

開頭也提到了 banner 廣告 CTR 的變化:

The first banner ad appeared in 1994. The average click-through rate (CTR) dropped from 2% in 1995 to 0.5% in 1998. After a relatively stable period with a 0.6% click-through rate in 2003, CTR rebounded to 1% by 2013.

所以這個現象有個專有名詞來形容...