阻擋廣告的攻性防壁 AdNauseam

看到「AdNauseam: Fight back against advertising surveillance」這個專案瞬間想到攻殼裡面「攻性防壁」這個詞 XDDD

改自 uBlock Origin,除了本來的隱藏廣告功能外,還會狂點廣告來亂 XDDD:

AdNauseam is a lightweight browser extension that blends software tool and artware intervention to fight back against tracking by advertising networks. AdNauseam works like an ad-blocker (it is built atop uBlock-Origin) to silently simulate clicks on each blocked ad, confusing trackers as to one's real interests. At the same time, AdNauseam serves as a means of amplifying users' discontent with advertising networks that disregard privacy and facilitate bulk surveillance agendas.

uBlock Origin 支援的 :has()

查資料的時候發現 uBlock Origin 的「Static filter syntax」已經自己實作 :has() 了 (雖然有一些限制)。

這個 CSS4 (draft) 的特性目前還沒有瀏覽器支援,所以 uBlock Origin 決定自己來:

This is a planned CSS4 operator, but no browser supports it yet. I decided to go ahead and implement it so that it can already be used. See The Relational Pseudo-class: :has() in the Selector Level 4/Editor's Draft.

由於效能問題,要求一定要有 hostname,而不能是 global rule:

uBO's implementation is simplified so as to ensure performance. The :has operator must be used with at least one hostname (it must be specific), and must be of the form (example)[.]

這對於 html block 長的幾乎一樣,只有在某個地方多出 Promoted by ... 之類的結構處理起來很方便,可以拿來找出「裡面有廣告 div 的母體 div」然後整包處理掉... (你不會只想要拿掉 Promoted by ...,而是連廣告內容都拿掉)

Adblock Plus 的公司開始賣網路廣告了...

哈哈,果然開始不擇手段了:「Adblock Plus now sells ads」,Adblock Plus 官方的說明在「New Acceptable Ads Platform launches, will redefine RTB and help small websites」這邊。

繼續用「uBlock Origin」,沒有虛偽的「Acceptable Ads」,只有速度更快,效果更好...

Facebook 用哪些資訊來決定投放給你的廣告

華盛頓郵報整理出來了 Facebook 的廣告所使用的 98 個個人資訊:「98 personal data points that Facebook uses to target ads to you」。

基本的個人資訊 (甚至是朋友的),以及使用什麼瀏覽器都可以預期;而 Like 或是參加的 Group 都會被計算也是意料中的事情,不過連信用卡的種類也都在內就頗特別的...

來檢視一下自己的防禦機制有哪些... 瀏覽器預設擋下第三方 cookie:

Ghostery 預設把所有外部元件擋下來,再用白名單開想要看的部份。用 uBlock Origin 擋下所有廣告。

另外用「Force Facebook Most Recent」強制 Facebook 轉到 Most Recent 的 Timeline 上。

不知道這樣夠不夠用...

最後來列出這 98 個條件:

  1. Location
  2. Age
  3. Generation
  4. Gender
  5. Language
  6. Education level
  7. Field of study
  8. School
  9. Ethnic affinity
  10. Income and net worth
  11. Home ownership and type
  12. Home value
  13. Property size
  14. Square footage of home
  15. Year home was built
  16. Household composition
  17. Users who have an anniversary within 30 days
  18. Users who are away from family or hometown
  19. Users who are friends with someone who has an anniversary, is newly married or engaged, recently moved, or has an upcoming birthday
  20. Users in long-distance relationships
  21. Users in new relationships
  22. Users who have new jobs
  23. Users who are newly engaged
  24. Users who are newly married
  25. Users who have recently moved
  26. Users who have birthdays soon
  27. Parents
  28. Expectant parents
  29. Mothers, divided by “type” (soccer, trendy, etc.)
  30. Users who are likely to engage in politics
  31. Conservatives and liberals
  32. Relationship status
  33. Employer
  34. Industry
  35. Job title
  36. Office type
  37. Interests
  38. Users who own motorcycles
  39. Users who plan to buy a car (and what kind/brand of car, and how soon)
  40. Users who bought auto parts or accessories recently
  41. Users who are likely to need auto parts or services
  42. Style and brand of car you drive
  43. Year car was bought
  44. Age of car
  45. How much money user is likely to spend on next car
  46. Where user is likely to buy next car
  47. How many employees your company has
  48. Users who own small businesses
  49. Users who work in management or are executives
  50. Users who have donated to charity (divided by type)
  51. Operating system
  52. Users who play canvas games
  53. Users who own a gaming console
  54. Users who have created a Facebook event
  55. Users who have used Facebook Payments
  56. Users who have spent more than average on Facebook Payments
  57. Users who administer a Facebook page
  58. Users who have recently uploaded photos to Facebook
  59. Internet browser
  60. Email service
  61. Early/late adopters of technology
  62. Expats (divided by what country they are from originally)
  63. Users who belong to a credit union, national bank or regional bank
  64. Users who investor (divided by investment type)
  65. Number of credit lines
  66. Users who are active credit card users
  67. Credit card type
  68. Users who have a debit card
  69. Users who carry a balance on their credit card
  70. Users who listen to the radio
  71. Preference in TV shows
  72. Users who use a mobile device (divided by what brand they use)
  73. Internet connection type
  74. Users who recently acquired a smartphone or tablet
  75. Users who access the Internet through a smartphone or tablet
  76. Users who use coupons
  77. Types of clothing user’s household buys
  78. Time of year user’s household shops most
  79. Users who are “heavy” buyers of beer, wine or spirits
  80. Users who buy groceries (and what kinds)
  81. Users who buy beauty products
  82. Users who buy allergy medications, cough/cold medications, pain relief products, and over-the-counter meds
  83. Users who spend money on household products
  84. Users who spend money on products for kids or pets, and what kinds of pets
  85. Users whose household makes more purchases than is average
  86. Users who tend to shop online (or off)
  87. Types of restaurants user eats at
  88. Kinds of stores user shops at
  89. Users who are “receptive” to offers from companies offering online auto insurance, higher education or mortgages, and prepaid debit cards/satellite TV
  90. Length of time user has lived in house
  91. Users who are likely to move soon
  92. Users who are interested in the Olympics, fall football, cricket or Ramadan
  93. Users who travel frequently, for work or pleasure
  94. Users who commute to work
  95. Types of vacations user tends to go on
  96. Users who recently returned from a trip
  97. Users who recently used a travel app
  98. Users who participate in a timeshare

阻擋 PIXNET 的三分鐘閒置視窗

在看宵夜文「2016更新【2013台北宵夜美食小吃精選】松山區信義區大安區」的時候做其他事情,回來就看到 in-window popup 視窗,決定擋下來,所以就把 html 找出來:

<div class="modal idle-pop" tabindex="-1" role="dialog" aria-describedby="dialog">
    <div class="modal-content">
      <div class="modal-header">本網頁已閒置超過 3 分鐘。請點 <kbd>關閉>/kbd> 或 <kbd>點擊</kbd>任一空白處,即可回到網頁</div>
      <div class="modal-body">

我選擇的方法是透過 uBlock Origin 阻擋元素:

pixnet.net##.idle-pop

然後重新開 blog 頁面,等個幾分鐘後確認就可以了。

Google Chrome 會 bypass Adblock 的問題

新版的 Google Chrome 使得 YouTube 可以繞過 Adblock 類軟體的阻擋限制 (像是 uBlock Origin),導致這些使用者會需要「看完完整的廣告影片 (無法 skip)」才能看本篇:「Google Chrome reportedly bypassing Adblock, forces users to watch full-length video ads」。

目前確認這是在修正 CVE-2015-1297 時產生的 bug:

Update: We have been contacted by Rob Wu, a developer on the Chromium project - the open-source foundation for the Chrome browser - who has informed us that this change was not intentional but, rather, an unintended result of fixing a previous security issue (CVE-2015-1297). He confirmed that the issue will only be seen if the YouTube app is installed and that, at the moment, apart from disabling AdBlock or whitelisting YouTube, the only solution, as described above, is to uninstall the app. The problem is expected to be patched in the upcoming weeks or, at least, when Chrome 46 is released.

目前的暫時解法是移除掉 YouTube 這隻 app,或是將 YouTube 放到白名單網站。

Google Chrome 與 Firefox 上擋廣告軟體的效能比較

在「10 Ad Blocking Extensions Tested for Best Performance」這篇看到各個 Ad Blocker 軟體的比較。

對各網站測試了載入速度、記憶體使用量、CPU 使用率,重點應該是最後的圖:

其中最知名的 AdBlock Plus (ABP) 會最慢的原因也很簡單,因為他預設值會放行廣告,這導致了效能掉很多:

If you’re wondering why the popular AdBlock Plus got low scores in some Chrome tests, the answer is simple and it’s purely down to the acceptable ads check box. Disable “Allow some non-intrusive advertising” and AdBlock Plus will performance wise, sit in the middle of the pack.

在 ABP 把 acceptable ads 擋掉後速度就比較接近了。不過,如果你願意接受 acceptable ads,也不應該選擇 ABP,因為其他也有支援 acceptable ads 的軟體效能比較好:

Whatever your opinion on acceptable ads, using the option in ABP is not recommended and if you wish to support showing specific ads while browsing, use something else. AdBlock, Adguard, AdRemover and SuperBlock all have an acceptable ads option of some sort, but none suffer a performance drop like ABP.

最後的結論,不論是 Google Chrome 或是 Firefox,贏家都是 uBlock Origin

The overall winner in Firefox is simply the quickest, and that was µBlock origin. µ AdBlock is a fair choice if you want an easy to use but fast blocker, the rest are almost identical so it’s down to personal preference and the options available as to which one you use.

The winner in Chrome is a closer call when you consider the results from all three tests. But as it got a couple of firsts and a second, we would say µBlock Origin is the definite winner, it truly is fast and efficient as the author claims. Both Ghostery and Adguard are still excellent choices and are viable alternatives to µBlock Origin providing good performance in all 3 categories.

Ghostery 雖然也會因為少讀很多東西進來而加快速度,不過拿來一起比好像怪怪的...

網路廣告愈來愈誇張,阻擋的功能變成趨勢了,在桌機上支援的軟體愈來愈完善,而在行動裝置上,iOS 9 也開始支援了:「Content blocking in iOS 9 is going to screw up way more than just ads」。

uBlock₀ 提供阻擋 WebRTC 取得 Local IP address 的功能

Google Chrome 上之前是透過 WebRTC Block 之類的軟體阻擋網站透過 WebRTC 取得 Local IP address 的功能,現在則內建在 uBlock₀ 內了。

在「You can block WebRTC from leaking your IP now in uBlock Origin」這邊看起來是這個月月初 (2015 年 7 月) 開發出來的功能。

WebRTC Leaktest 交叉測試可以發現 Public IP address 的部份,目前測過的套件都擋不下來,但 Private IP address 的部份都有順利擋下來。

又可以少裝一個套件了...

uBlock 的改版:交接後再 fork 成 uBlock Origin (uBlock₀)

原先的 µBlock 改名成 uBlock₀,並且把 uBlock 的名字交出去給了 Colorado SpringsuBlock

原因可以在「Please clarify uBlock₀ vs. uBlock」這邊看到,由於這不是 full time job (他也不想要成為 full time job),所以他決定 freeze 目前的功能,僅維持 bugfix (因為對他來說夠用了,他自己平常也在用)。

依照這個原因,我的感覺是 uBlock 會成圍下一個肥大的 ABP,就乖乖留守 uBlock Origin (uBlock₀) 吧。

Firefox 版的 µBlock

翻資料才知道一月中的時候 µBlock 就支援 Firefox 了:「µBlock - An efficient blocker for Chromium, Firefox, and Safari. Fast and lean.」。

可以看到不遺餘力的酸 Adblock Plus,裝了 ABP 記憶體使用量反而變大,而且變慢很多:

目前只提供 xpi 檔下載安裝,暫時沒有在 addons.mozilla.org 上出現。