MozTW 討論區

各項 Mozilla 相關軟體與技術討論
現在的時間是 2024-05-09, 15:10

所有顯示的時間為 UTC + 8 小時





發表新文章 回覆主題  [ 5 篇文章 ] 
發表人 內容
文章發表於 : 2014-06-11, 11:11 
離線

註冊時間: 2008-08-27, 10:07
文章: 169
例如我想過濾以下規則:
s.yimg.com###ydcm-579482007410
可以想像的是579482007410是會隨機產生的,光是加上面規則沒什麼用,如果可以用萬用字元,如
s.yimg.com###ydcm-*
應該就可以防止隨機產生的變數,可是目前為止
請問Adblock plus及Element Hiding Helper for Adblock Plus是不能萬用字元表示的,為什麼作者沒想到這個盲點呢?


回頂端
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
 個人資料  
引用回覆  
文章發表於 : 2014-06-14, 17:29 
離線

註冊時間: 2008-05-03, 11:00
文章: 78
來自: 硬件浮雲聯萌
代碼:
s.yimg.com##*[id^="ydcm-"]


參考 https://adblockplus.org/en/filters#elemhide
引言回覆:
Attribute selectors

Some advertisers don't make it easy for you — their text advertisements have neither an id nor a class attribute. You can use other attributes to hide those, for example ##table[width="80%"] will hide tables with width attribute set to 80%. If you don't want to specify the full value of the attribute, ##div[title*="adv"] will hide all div elements with title attribute containing the string "adv". You can also check the beginning and the end of an attribute, for example ##div[title^="adv"][title$="ert"] will hide div elements with title starting with "adv" and ending with "ert". As you see, you can also use multiple conditions — table[width="80%"][bgcolor="white"] will match tables with width attribute set to 80% and bgcolor attribute set to white.


以及 https://adblockplus.org/en/filter-cheatsheet#elementselection

_________________
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH


回頂端
Opera/9.80 (Windows NT 6.1; Edition Next) Presto/2.12.388 Version/12.17
 個人資料  
引用回覆  
文章發表於 : 2014-06-20, 11:05 
離線

註冊時間: 2008-08-27, 10:07
文章: 169
謝啦,研究看看,雖然有點難。
請問s.yimg.com##*[id^="ydcm-"]
其中*是什麼意思,我網官網看範例,好像沒有這個


回頂端
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
 個人資料  
引用回覆  
文章發表於 : 2014-06-20, 22:37 
離線

註冊時間: 2008-05-03, 11:00
文章: 78
來自: 硬件浮雲聯萌
abp的元素隱藏規則本質上是給相關站點插入 user css
給由 css selector 指定的元素設置 display:none!important;
而那個 * 在 css selector 中表示匹配所有元素

可以參考 https://adblockplus.org/en/filters#elemhide 中這段
引言回覆:
The first advertisement above is contained inside a div element with class attribute "textad". The following rule will hide exactly this combination: ##div.textad. Here ## marks an element hiding rule while the rest is a selector identifying the elements that need to be hidden. You can hide elements by their id attribute similarly, ##div#sponsorad will hide the second advertisement. You don't need to specify the element name, the rule ##*#sponsorad will work just as well. And you can hide elements by element name only, e.g. ##textad for the third advertisement.


更進一步的請參考 css selector
比如
http://www.w3schools.com/CSSref/css_selectors.asp
https://developer.mozilla.org/docs/Web/Guide/CSS/Getting_started/Selectors

_________________
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH


回頂端
Opera/9.80 (Windows NT 6.1; Edition Next) Presto/2.12.388 Version/12.17
 個人資料  
引用回覆  
文章發表於 : 2014-06-30, 09:53 
離線

註冊時間: 2008-08-27, 10:07
文章: 169
很有幫助,謝啦!


回頂端
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
 個人資料  
引用回覆  
顯示文章 :  排序  
發表新文章 回覆主題  [ 5 篇文章 ] 

所有顯示的時間為 UTC + 8 小時


誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 12 位訪客


不能 在這個版面發表主題
不能 在這個版面回覆主題
不能 在這個版面編輯您的文章
不能 在這個版面刪除您的文章
不能 在這個版面上傳附加檔案

搜尋:
前往 :  
Powered by phpBB® Forum Software © phpBB Group
正體中文語系由 竹貓星球 維護製作
© moztw.org, Mozilla Foundation
MozTW,Mozilla 台灣社群