Skip to content

资源库

fang5566 edited this page Mar 18, 2019 · 16 revisions

常规目的小脚本

  • 大多数脚本都依赖于 Object properties (methods),所以最好不要修改这些脚本(你需要知道你在什么)。
  • 如未指定,"string/regular expression" 参数中的“可选参数”默认为 "catch all" (/.?/)。
  • "string" 参数表示普通字符或单词,引号 will be taken literally, commas must be escaped in regex literals: /foo\x2cbar\u002cbaz/
  • "regular expression" 参数表示 JavaScript 正则表达式
  • mime type 如未出现则为 application/javascript

abort-current-inline-script.js

该脚本用于中止执行内联脚本 (throws ReferenceError),发生情况是当<script> element 的内容与指定文本或 regular expression 匹配时尝试访问指定的 property

参数:

  • 必需参数:property (用 . 连接的 property 链),附属于我们要中断的 <script> 标签内所访问的 window object
  • 可选参数:匹配 <script> element 中的内容的 string/regular expression

abort-on-property-read.js

中止执行脚本 (throws ReferenceError),发生情况是尝试读取指定的 property,如为写入则忽略。 参数:

  • 必需参数:property (用 . 连接的 property 链),附加到 window object

abort-on-property-write.js

中止执行脚本 (throws ReferenceError),发生情况是尝试写入指定的 property

参数:

  • 必需参数:property (用 . 连接的 property 链),附加到要被覆盖的 window object

addEventListener-defuser.js

阻止附带事件监听器(event listeners)。

参数:

  • 可选参数:string/regular expression 及事件监听器的名称
  • 可选参数:在字符串化 (stringified)句柄函数里匹配的 string/regular expression

addEventListener-logger.js

在页面创建的控制台事件监听器的日志


cookie-remover.js

Removes current page cookies specified by name. For current domain, wildcard (dot) subdomain, current and / path, script accessible (HttpOnly=false), on load and before unload.

Caveats: cookies set for higher level domain will not be removed. For example, if current page domain is www.example.com, cookies set for example.com will not be removed.

Parameters:

  • optional, string/regular expression, matching in the name of the cookie

csp.js

已被 $csp 网络规则选项弃用。
通过插入 <meta http-equiv=Content-Security-Policy content="*directive*"> 标签到 html <head> element 使 CSP 生效。 更多内容参见 https://www.w3.org/TR/CSP2/#delivery-html-meta-element

参数:

  • 必需参数:有效的 CSP(内容安全策略)规则

disable-newtab-links.js

通过反激活带有 target 属性的链接阻止创建新的标签页或窗口。

参数:


noeval.js

阻止网页使用 eval(),并将网页尝试使用信息报告到控制台。


silent-noeval.js

阻止网页使用 eval()


noeval-if.js

阻止网页使用 eval() 在特定的匹配的净负荷上。

参数:

  • 可选参数:string/regular expression、要与净负荷字符串匹配。

nowebrtc.js

禁用 WebRTC,方式是通过阻止页面使用 RTCPeerConnection()。控制台会显示上报的尝试信息。


remove-attr.js

移除 DOM 树节点的属性 (attribute)。该脚本仅在页面加载完成后运行一次。 参数:

  • 必需参数:属性或用 | 连接的属性列表
  • 可选参数:CSS 选择符、指定的其属性将被移除的节点

set-constant.js

创建 property 并从可用的 property 集中初始化到预定义的值。

参数:

  • 必需参数:property (用 . 连接的 property 链),附加到 window object
  • 必需参数:可用的值:
    • 十进制的正整数,无正负号,最大值为 0x7FFF (32767)
    • 预定义常数集中的一个值:
      • undefined
      • false
      • true
      • noopFunc - body 为空的函数
      • trueFunc - 返回 true 的函数
      • falseFunc - 返回 false 的函数
      • '' - empty string2019-01-06

setInterval-defuser.js

通过设置回调函数为 noop 来为指定的所匹配的回调函数和时间间隔去除 setInterval() 函数的调用。

参数:

  • 可选参数:在字符串化的回调函数里匹配的 string/regular expression
  • 可选参数:与时间间隔匹配的十进制整数

setInterval-logger.js

调用 setInterval() 函数时的控制台日志。


setTimeout-defuser.js

通过设置回调函数为 noop 来为指定的所匹配的回调函数和延迟去除 setTimeout() 函数的调用。

参数:

  • 可选参数:在字符串化的回调函数里匹配的 string/regular expression
  • 可选参数:与延迟匹配的十进制整数

setTimeout-logger.js

调用 setTimeout() 函数的控制台日志。


nano-setInterval-booster.js

调整指定的 setInterval() 回调函数的时间间隔。

参数:

  • 可选参数:在字符串化的回调函数里匹配的 string/regular expression
  • 可选参数 - 与时间间隔匹配的十进制整数,默认为 1000
  • 可选参数 - 时间间隔倍乘器(multiplier),默认为 0.05(20x 倍速),浮点,限制在上下 50 倍

nano-setTimeout-booster.js

调整指定的 setTimeout() 回调函数的延迟。

Parameters:

  • optional, string/regular expression, matching in stringified callback function
  • optional - defaults to 1000, decimal integer, matching delay
  • optional - default to 0.05 (20x faster), float, capped at 50 times for up and down, delay multiplier

sharedWorker-defuser.js

已被 $csp 过滤规则选项弃用。 Defuses sharedWorker by passing empty worker file (Blob URL) for specified worker URLs

Parameters:

  • optional, string/regular expression, matching in worker URL

window.open-defuser.js

当 URL 积极或消极地匹配到指定字符串时阻止通过 window.open() 打开新窗口。

Parameters:

  • optional - defaults to "matching", any positive number for "matching", 0 or any string for "not matching",
  • optional, string/regular expression, matching/not matching in URL parameter passed to window.open()

window.name-defuser

清除 window.name property,避免被误用于跟踪用户。

参数:


overlay-buster.js

Experimental, gets rid of overlay dialogs, works for ~30s after page load. Preferred way to handle overlays is to use standard cosmetic filters and optionally style injection.


alert-buster.js

Disables alert() dialog boxes by redirecting messages to console.


Defuser 小脚本

ampproject.org/v0.js

Removes animation (artificial 8s delay) added to desktop pages supporting AMP, when ampproject.org scripts are blocked.

fingerprint2.js

Defuses Fingerprintjs2. Sanitize Fingerprint2 object.

pornhub-popup-defuser.js

Sets specific localStorage items (InfNumFastPops, InfNumFastPopsExpire)

forbes-defuser.js

Fix '/forbes/welcome/' page redirection. Redirects to URL from toURL cookie

bab-defuser.js

Defuses BlockAdblock. Prevents executing of eval() on sets of predefined payloads.

phenv-defuser.js

Defuses "g0yav3-lab" Anti Adblock. TODO Deprecated, sets static properties (PHENV)

sas-defuser.js

Deprecated, Convenience, sets static properties (Ads.display, Ads.refresh) TODO: Convenience means "patches more than one property", I keep this here, not in "Other", just in case.

fuckadblock.js-3.2.0

Convenience, Sanitize FuckAdBlock, BlockAdBlock, SniffAdBlock, fuckAdBlock, blockAdBlock, sniffAdBlock properties. Often used as redirect in network filters. TODO: copy to redirect?

lemonde-defuser.js

Sets specific localStorage item (lmd_me_displayed)

popads-dummy.js

Convenience, sets static properties (PopAds, popns)

popads.net.js

Convenience, abort-on-property-write.js (PopAds, popns), throws "magic"

rtlfr-defuser.js

Deprecated by :style() cosmetic filter. Applies overflow: auto style to document body element after window load event.

uabinject-defuser.js

Defuses Addefend, convenience, sets static properties (trckd, uabpdl, uabInject, uabDetect)

impspcabe-defuser.js

Deprecated, Convenience, sets static properties (_impspcabe, _impspcabe_alpha, _impspcabe_beta, _impspcabe_path) TODO: not used, static properties, cannot be set to about:blank by sciptlets is this really needed, used on 4 domains

gpt-defuser.js

Deprecated, Convenience, sets static properties (_resetGPT, resetGPT, resetAndLoadGPTRecovery, _resetAndLoadGPTRecovery, setupGPT, setupGPTuo)

palacesquare.rambler.ru-defuser.js

Aborts creation of Promise when executor content matches 'getRandomSelector' (throws Error) TODO: Freezes Promise properties?

adfly-defuser.js

Defuses anti adblock on adfly shortened links.

damoh-defuser.js

Fix for disappearing videos on chip.de


Empty redirect resources

These are smallest/shortest/fastest to execute files. Can be used in network filters as a parameter to $redirect option along with specific matching $type option. They purpose is to mislead page to think that real files have been served.

Supported types

TODO: filter types, mime types, this needs clarification TODO: how filter type relates to mime type, needs more source digging font, image, media, object, script, stylesheet, subdocument, xmlhttprequest

Available resources

  • Images
    • 1x1-transparent.gif image/gif;base64 $image
    • 2x2-transparent.png image/png;base64 $image
    • 3x2-transparent.png image/png;base64 $image
    • 32x32-transparent.png image/png;base64 $image
  • Source code
    • noopcss text/css $stylesheet
    • noopframe text/html $subdocument
    • noopjs application/javascript $script
    • nooptext text/plain $xmlhttprequest
  • Media files
    • noopmp3-0.1s audio/mp3;base64 $media
    • noopmp4-1s video/mp4;base64 $media

TODO: object and font resources are missing? Find discussion about adding them on demand.


URL-specific sanitized redirect resources (surrogates)

addthis.com/addthis_widget.js

amazon-adsystem.com/aax2/amzn_ads.js

d3pkae9owd2lcf.cloudfront.net/mb105.js

doubleclick.net/instream/ad_status.js

google-analytics.com/ga.js

google-analytics.com/analytics.js

google-analytics.com/inpage_linkid.js

google-analytics.com/cx/api.js

googletagservices.com/gpt.js

googletagmanager.com/gtm.js

googlesyndication.com/adsbygoogle.js

scorecardresearch.com/beacon.js

widgets.outbrain.com/outbrain.js

hd-main.js

xvideos.com.js

disqus.com/forums/*/embed.js AND disqus.com/embed.js

Along with Disqus click-to-load filter list, allows to have Click-to-ublock experience for Discus comments widgets.

twitch-videoad.js

Twitch stream embedded ads bypasser


其他

Deprecated by general purpose scriptlets / outdated

antiAdBlock.js

Sanitize antiAdBlock.onDetected, antiAdBlock.onNotDetected

pornhub-sanitizer.js

Removes ad frames on Pornhub (block_logic)

nr-unwrapper.js

Fix memory leaks on spotify, newrelic. https://github.com/uBlockOrigin/uAssets/issues/36

gamespot.com.js

Removed. Calls pf_notify with false parameter. Attempt to fix gamespot video player and image viewer.

sidereel.com.js

Removed. Sets specific localStorage item (__trex)

videowood.tv.js

Removed. Sanitize adb_remind after eval()

adf.ly.js

Removed. Sanitize abgo after eval()


golem.de.js

Deprecated, addEventListener-defuser

trafictube.ro.js

Deprecated, setInterval-defuser

uAssets-17

Deprecated, setTimeout-defuser

last.fm.js

Deprecated, setTimeout-defuser

ytad-defuser.js

Deprecated, setTimeout-defuser, fix for YouTube "An error occured"

indiatimes.com.js

Removed. addEventListener-defuser

trafictube.ro.js

Removed. setInterval-defuser


bcplayer-defuser.js

Deprecated, sets static properties (bcPlayer.ads)

wpredirect-defuser.js

Deprecated, sets static properties (TWP.Identity.initComplete)

kissanime-defuser.js

Deprecated, sets static properties (DoDetect1, DoDetect2, isBlockAds2)

__$dc-defuser.js

Deprecated, sets static properties (Math.mt_random), throws TypeError

upmanager-defuser.js

Deprecated, sets static properties (upManager)

r3z-defuser.js

Deprecated, sets static properties (_r3z.jq, _r3z.pub)

folha-de-sp.js

Deprecated, sets static properties (folha_ads)

static.chartbeat.com/chartbeat.js

Deprecated, sets static properties (pSUPERFLY.activity, pSUPERFLY.virtualPage)

entrepreneur.com.js

Deprecated, sets static properties (analyticsEvent)

ligatus.com/*/angular-tag.js

Deprecated, sets static properties (adProtect, uabpdl, uabDetect)

openload.co.js

Deprecated, sets static properties (adblock2, OlPopup, preserve, turnoff)

imore-sanitizer.js

Deprecated, sets static properties (mbn_zones)

smartadserver.com.js

Deprecated, sets static properties (SmartAdObject, SmartAdServerAjax, smartAd.LoadAds, smartAd.Register)

lesechos.fr.js

Deprecated, sets static properties (checkAdBlock)

criteo.net.js

Deprecated, sets static properties (Criteo.criteo)

goyavelab-defuser.js

Deprecated, sets static properties (_$14)

figaro-defuser.js

Deprecated, sets static properties (adisplaynormal)

hindustantimes.com.js

Removed. Sets static properties (canRun)

bhaskar.com.js

Removed. Sets static properties (canABP)

indiatoday.intoday.in.js

Removed. Sets static properties (adBlock, checkAds)

thesimsresource.com.js

Removed. Sets static properties (gadsize, iHaveLoadedAds, OX)

ndtv.com.js

Removed. Sets static properties (___p_p)

wetteronline.de.js

Removed. Sets static properties (xq5UgyIZx, doAbCheck), throws TypeError

ideal.es.js

Removed. Sets static properties (is_block_adb_enabled)

livescience.com.js

Removed. Sets static properties (tmnramp)

lachainemeteo.com.js

Removed. Sets static properties (pliga.push)


术语表

Clone this wiki locally