Sharing Custom Filters

Sharing Custom Filters

Here are some custom filters which may be useful. These filters can be added by using the Import Filter plugin.

If a filter causes problem to a page, the affected site can be uded by adding its url to the "ExcludedUrls" keywords list.



Index of Filters


Supplemental Blockers
Disable ActiveX
Disable Java Applets
Disable Scripting
Disable Flash
Disable Sound
Disable Mouse Restrictions
Disable Custome Cursors
Disable Custom Scrollbar
Disable Blank Download Tab
Open Links in New Tabs
Disable Caching
Enble Caching
Define Charset
Change User Agent
All Cookies Session Only
Auto Refresh
Remove ads on aftonbladet.se
Remove Firefox Ads
Supplemental Blockers

This filter group consists of 5 custom filters:

1. Inject Start Script - inject a script which blocks most IE only dialogs (modal, modeless, print, add favorites, etc), check this page for details. Blocking/automatic answering of alerts, confirmations and prompts will be added in the future.

2. Rewrite External Methods - enable the start script to redefine the behavior of some IE dialogs for intelligent blocking.

3. Remove Sneaky Iframes - remove iframes with height and width less than 5px, which are used mostly for tracking, opening ads, or injecting virus.

4. Disable Script Clicks - disable the automatic click function, which is used mostly for opening ads in a new window.

5. Inject End Script - inject a script to remove floating ads. More functions may be added in the future.

To use this filter, the attached file has to be downloaded and extracted to the C: drive. The extracted folder "Html" can be moved to other location but the path of the injected script in the "Inject Start Script" and "Inject End Script" filter have to be adjusted accordingly.

CODE
        <group name="Supplemental Blockers" enable="1">
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Inject Start Script" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match="(&lt;html[^&gt;]*&gt;|&lt;head&gt;)(.*)(&lt;meta[^&gt;]*charset[^&gt;]*&gt;)|(&lt;html[^&gt;]*&gt;|&lt;head&gt;)" match_count="1" replace="$1$3$4&lt;script type=&quot;text/javascript&quot; src=&quot;C:\\Html\\JS_start.js&quot;&gt;&lt;/script&gt;$2" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="" max_bound_size="0" exclude="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Rewrite External Methods" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match="\.(AddFavorite|AddChannel|AddDesktopComponent|ShowBrowserUI|setHomePage)" match_count="0" replace="_$1" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="" max_bound_size="0" exclude="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Remove Sneaky Iframes" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match=".*\swidth\W*=\W*[0-5]\W.*\sheight\W*=\W*[0-5]\W.*|.*\sheight\W*=\W*[0-5]\W.*\swidth\W*=\W*[0-5]\W.*" match_count="0" replace="&lt;!-- Removed Sneaky Iframe --&gt;" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="&lt;iframe.*?&lt;/iframe&gt;" max_bound_size="0" exclude="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Disable Script Clicks" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match="\.(click)" match_count="0" replace="\.no_$1" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="" max_bound_size="0" exclude="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Inject End Script" author="" type="text" comment="" action="3" postaction="0" priority="0" match="$FILEEND()" match_count="1" replace="&lt;script type=&quot;text/javascript&quot; src=&quot;C:\\Html\\JS_end.js&quot;&gt;&lt;/script&gt;" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="" max_bound_size="0" exclude="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
        </group>

Attachment

Html.zip (1.9 KB)

2006-7-24 15:17, Downloads: 1333

That's great abc@home [] I was waiting for this topic like the one in the chinese zone.


منتدي ماكستون العربي عاد مجدداً
http://arabicmaxthon.ismywebsite.com
(الكل يدعي للسيت أنه يفضل أونلاين لمده أكتر من شهر :tongue:)
Open Links in New Tabs

CODE
        <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Open Links in New Tab" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match="(.*)&gt;" match_count="0" replace="$1 target=_blank&gt;" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="&lt;a\s[^&gt;]*&gt;" max_bound_size="0" exclude="javascript|onclick|_blank|\.(ZIP|RAR|7Z|GZ|GZIP|ACE|ARJ|CAB|LZH|TAR|EXE|BIN|ISO|RM|AVI|WMV|WMA|MP3|MPG|TORRENT)" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
Disable Blank Download Tab

CODE
        <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Disable Blank Download Tab" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match="(.*target\W*=\W*_)blank(.*)" match_count="0" replace="$1self$2" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="&lt;a[^&gt;]*href[^&gt;]*(?:act=attach|view=att|attachment|\.(?:ZIP|RAR|7Z|GZ|GZIP|ACE|ARJ|CAB|LZH|TAR|EXE|BIN|ISO|RM|AVI|WMV|WMA|MP3|MPG|TORRENT))[^&gt;]*&gt;" max_bound_size="0" exclude="javascript|onclick|_self" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
Disable Custom Scrollbar

CODE
        <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Disable Custom ScrollBar" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match="scroll(bar[a-z-]{4,12}color)" match_count="0" replace="scroll_$1" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="" max_bound_size="0" exclude="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
Remove ads on aftonbladet.se

CODE
  <group name="Aftonbladet.se" enable="1">
   <filter enable="1" name="Aftonbladet Ads" author="carpediem" type="text" comment="" action="3" postaction="0" priority="0" match="OAS_AD\('.*?\'\);" match_count="0" replace="" update="" match_url="http://www.aftonbladet.se/.*" exclude_url="" bound="" max_bound_size="0" exclude="" ver="1.0" keywords=""/>
   <filter enable="1" name="Aftonbladet removed AD IDs'" author="carpediem" type="text" comment="" action="3" postaction="0" priority="0" match="id=&quot;(jobads|medianetAd|frmBannerSearch|AB_ad.*?|AB_shAnnons.*?)" match_count="0" replace="id=&quot;$1&quot; style=&quot;display:none;&quot;" update="" match_url="http://www.aftonbladet.se/.*" exclude_url="" bound="" max_bound_size="0" exclude="" ver="1.0" keywords=""/>
   <filter enable="1" name="Aftonbladet AD Classes" author="carpediem" type="text" comment="" action="3" postaction="0" priority="0" match="class=&quot;(jobb24searchbox)" match_count="0" replace="class=&quot;$1&quot; style=&quot;display:none;&quot;" update="" match_url="http://www.aftonbladet.se/.*" exclude_url="" bound="" max_bound_size="0" exclude="" ver="1.0" keywords=""/>
  </group>


[Intel Core i7 920, 12GB RAM | ATI 4870 PCI-E 2GB |30" TFT @ 2560x1600 | Windows 7 Ultimate]

Temporary Vulnerability Fix

Fix this highly critical vulnerability until official patched is released. (Update: The vulnerability is patched in Aug 2006 windows updates. This filter is NOT necessary for fully patched windows.)

CODE
        <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" name="Temporary Vulnerability Fix" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match="(Internet)\.(HHCtrl\.1)" match_count="0" replace="$1_$2" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="" max_bound_size="32" exclude="" ver="1.0" keywords="" enable="1"><keywords name="ExcludedUrls"></keywords></filter>

Disable ActiveX

1. Remove activex objects except:
flash: d27cdb6e-ae6d-11cf-96b8-444553540000
realplayer: cfcdaa03-8be4-11cf-b84b-0020afbbccfa
wmplayer: 6bf52a52-394a-11d3-b153-00c04f79faa6 & 22d6f312-b0f6-11d0-94ab-0080c74c7e95
quicktime: 02bf25d5-8c17-4b23-bc80-d3488abddc6b
java applet: 8AD9C840-044E-11D1-B3E9-00805F499D93 & CAFEEFAC-....-....-....-ABCDEFFEDCBA

2. Disable scripting activex controls except:
ShockwaveFlash
WMPlayer.OCX
XMLHTTP
XMLDom

Note: If you use this filter, you do not need to use the Temporary Vulnerability Fix above.

CODE
        <group name="Disable ActiveX" enable="1">
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Remove ActiveX Objects" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match=".*classid.*" match_count="0" replace="&lt;!-- ActiveX Object Removed --&gt;" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="&lt;object.*?&lt;/object&gt;" max_bound_size="0" exclude="d27cdb6e-ae6d-11cf-96b8-444553540000|cfcdaa03-8be4-11cf-b84b-0020afbbccfa|6bf52a52-394a-11d3-b153-00c04f79faa6|22d6f312-b0f6-11d0-94ab-0080c74c7e95|02bf25d5-8c17-4b23-bc80-d3488abddc6b|8AD9C840-044E-11D1-B3E9-00805F499D93|CAFEEFAC-....-....-....-ABCDEFFEDCBA" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Disable Scripting ActiveX Controls" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match="(ActiveX|Create)(Object\s*[(][^)]*[)])" match_count="0" replace="$1_$2" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="" max_bound_size="128" exclude="ShockwaveFlash|WMPlayer.OCX|XMLHTTP|XMLDom" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
        </group>
Define Charset

Some web pages have neither content-type <meta> tag nor charset defined in the content-type header. For users visiting web pages in different encodings, these web pages may not be properly encoded. This filter defines charset in the content-type header for such pages.

CODE
        <group name="Define Charset" enable="1">
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Western" author="abc@home" type="responseheader" comment="" action="3" postaction="" priority="" match="(text\/\w*html).*" header="Content-Type" update="" match_url="$KEYWORDS(MatchUrl)" exclude_url="" replace="$1; charset=iso-8859-1" exclude="" return="" ver="1.0" keywords=""><keywords name="MatchUrl"><item>foxsports.com</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Simplified Chinese" author="abc@home" type="responseheader" comment="" action="3" postaction="" priority="" match="(text\/\w*html).*" header="Content-Type" update="" match_url="$KEYWORDS(MatchUrl)" exclude_url="" replace="$1; charset=gb2312" exclude="" return="" ver="1.0" keywords=""><keywords name="MatchUrl"><item>Add_Url_Here</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Traditional Chinese" author="abc@home" type="responseheader" comment="" action="3" postaction="" priority="" match="(text\/\w*html).*" header="Content-Type" update="" match_url="$KEYWORDS(MatchUrl)" exclude_url="" replace="$1; charset=big5" exclude="" return="" ver="1.0" keywords=""><keywords name="MatchUrl"><item>Add_Url_Here</item></keywords></filter>
        </group>
Very nice abc [:smile:] Just hope that an easy import guide will be implemented.... Select text, right click, import for example. Also merging an .m2filter file with the existing perhaps [:smile:] Or use several external files, or or or [] Just "realized" that it's very easy to add javascript functions (userscripts) to the JS_end.js file in order to add some nice functionality to pages. Added linkify and "external pages in new tabs" js and it works great!

[Intel Core i7 920, 12GB RAM | ATI 4870 PCI-E 2GB |30" TFT @ 2560x1600 | Windows 7 Ultimate]

Good work abc and great suggestion carpe&#33;
OS: Windows XP Sp2 IE: 6.0 Sp2 Maxthon last Unicode Version Skin: No Skin

More info: Deutsches Forum -- Maxthon - deutsche Homepage -- Skins Collection
Yes, a simplier way to import filter is necessary. The end script is indeed very useful. It's similar to auto start script plugins in 1.x but acts much earlier. It is also possible to use a plugin to add the max security id to the script when maxthon starts to make it even more useful. But some script may not work properly until the page is fully loaded. Just find that "$FILEEND()" can be used to inject the end script. I thought that it was disabled for public use when I tried "$FILEEND", which didn't work.
Disable Caching

Enter url of sites to the MatchUrl list to disable caching.

CODE
        <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Disable Caching" author="abc@home" type="responseheader" comment="" action="2" postaction="" priority="" match="" header="Cache-Control" update="" match_url="$KEYWORDS(MatchUrl)" exclude_url="" replace="no-cache" exclude="" return="" ver="1.0" keywords=""><keywords name="MatchUrl"><item>Add_Url_Here</item></keywords></filter>
Enble Caching

Disable meta tags and remove http headers which disable or restrict caching.

CODE
        <group name="Enable Caching" enable="1">
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Disable Anti-Cache Tags" author="abc@home" type="text" comment="" action="3" postaction="0" priority="1" match="&lt;(meta.*(?:cache|pragma|expires).*)" match_count="0" replace="&lt;no_$1" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="&lt;meta[^&gt;]*&gt;" max_bound_size="256" exclude="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Remove Cache-Control" author="abc@home" type="responseheader" comment="" action="1" postaction="" priority="" match=".*" header="Cache-Control" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" replace="" exclude="" return="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Remove Cache-Expires" author="abc@home" type="responseheader" comment="" action="1" postaction="" priority="" match=".*" header="Cache-Expires" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" replace="" exclude="" return="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Remove Expires" author="abc@home" type="responseheader" comment="" action="1" postaction="" priority="" match=".*" header="Expires" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" replace="" exclude="" return="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Remove Pragma" author="abc@home" type="responseheader" comment="" action="1" postaction="" priority="" match=".*" header="Pragma" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" replace="" exclude="" return="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>
        </group>

I have not tested these filters yet, but it really looks cool, seems to be very powerful. However, I wonder if we will be able to rightclick and remove certain objects in the future? FF has this functionality and it´s real handy. And perhaps M2 should also offer the Opera style of ad removing, this way it will be easier to block Flash adds. Right now I´m using Floatbar to do this, hopefully this plugin will be improved and ported to M2. [:smile:]
Maxthon 1.5.0.95 | Windows XP Pro SP2
Remove Firefox Ads

CODE
        <filter uid="0267f7b72118feb27a14846eb91a1bae39062d7840a097e79262e77cf9c6fbf2" enable="1" name="Firefox Ad" author="oscm" type="text" comment="" action="3" postaction="0" priority="0" match="function\shasIE_hasIE\(\)" match_count="0" replace="function hasIE_hasIE_AD(){return false;} function hasIE_hasIE_AD()" update="" match_url="" exclude_url="" bound="" max_bound_size="0" exclude="" ver="1.0" keywords=""/>
At last, I was waiting for this one []


منتدي ماكستون العربي عاد مجدداً
http://arabicmaxthon.ismywebsite.com
(الكل يدعي للسيت أنه يفضل أونلاين لمده أكتر من شهر :tongue:)
Change User Agent

Not sure how this can be useful but if you wish, add url of websites where you want to fake the user agent.

CODE
        <group name="Change User Agent" enable="0">
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Firefox" author="abc@home" type="requestheader" comment="" action="3" postaction="" priority="" match="^.*" header="User-Agent" update="" match_url="$KEYWORDS(MatchUrl)" exclude_url="" replace="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6" exclude="" return="" ver="1.0" keywords=""><keywords name="MatchUrl"><item>Add_Url_Here</item></keywords></filter>
            <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="1" name="Opera" author="abc@home" type="requestheader" comment="" action="3" postaction="" priority="" match="^.*" header="User-Agent" update="" match_url="$KEYWORDS(MatchUrl)" exclude_url="" replace="Opera/9.01 (Windows NT 5.1; U; en)" exclude="" return="" ver="1.0" keywords=""><keywords name="MatchUrl"><item>Add_Url_Here</item></keywords></filter>
        </group>

Disable Custome Cursors

CODE
        <filter uid="392e95d236f04059790aa3afb628f7bdec718b347bfe61068994f8a1ec86b903" enable="0" name="Disable Custom Cursors" author="abc@home" type="text" comment="" action="3" postaction="0" priority="0" match="cursor([^;}&quot;'&gt;&lt;]{0,20}url)" match_count="0" replace="cur_sor$1" update="" match_url="" exclude_url="$KEYWORDS(ExcludedUrls)" bound="" max_bound_size="32" exclude="" ver="1.0" keywords=""><keywords name="ExcludedUrls"><item>mail.google.com</item><item>update.microsoft.com</item></keywords></filter>