Related subject: blocking facebook.com outside facebook.com domain
This is from default.filter
#################################################################################
#
# shockwave-flash: Kill embedded Shockwave Flash objects.
# Note: Better just block "/.*\.swf$"!
#
#################################################################################
FILTER: shockwave-flash Kill embedded Shockwave Flash objects.
s|<object [^>]*macromedia.*</object>|<!-- Squished Shockwave Object -->|sigU
s|<embed [^>]*(application/x-shockwave-flash\|\.swf).*>(.*</embed>)?|<!-- Squished Shockwave Flash Embed -->|sigU
This is how you implement it in the .action file
#############################################################################
# Kill embedded Shockwave SWF objects
#############################################################################
{+filter{shockwave-flash}}
.funny-games.biz/
Works fine, but...
I am failing to achieve my wanted result
.filter:
#################################################################################
#
# trace-widget: Get rid of particularly annoying so-called sharing buttons.
#
#################################################################################
FILTER: trace-widget Kill embedded spying buttons.
s|<script [^>]*.twitter.*</script>|<!-- Squished Twitter Object -->|sigU
.action:
#----------------------------------------------------------------------------
# Deny access for Facebook Google and Twitter scripts
#----------------------------------------------------------------------------
{+filter{trace-widget}}
/
What is wrong with it?
I am puzzled on how it can be applied for frames and scripts like:
Twitter:
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
Google: g+ analytics etc.
<g:plusone annotation="inline"></g:plusone>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
Facebook:
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<a name="fb_share" type="button_count" share_url="..." href="http://www.facebook.com/sharer.php">Share</a>
<iframe frameborder='0' id='facebook_like' scrolling='no' src='https://www.facebook.com/plugins/like.php?href=...'></iframe>
Your help is deeply appreciated.
Update (working filter rules)
Facebook:
s|<a [^>]*(sharer.php).*>(.*</a>)|<!-- Squished Facebook Object -->|sigU
s|<iframe [^>]*(like.php).*>(.*</iframe>)|<!-- Squished Facebook Frame -->|sigU
(this would be better if a facebook.com and fbcdn.net domains be added to these rules so that it won't block any other PHP or JS or other contents of the current website)
Google: (not always working - cutroni.com)
s|<script [^>]*(plusone.js).*>(.*</script>)|<!-- Squished Google Button -->|sigU
Twitter: (work with fenopy.eu but not with The Pirate Bay HTTPS pages https://thepiratebay.org/) (not always working - cutroni.com)
s|<script [^>]*(widgets.js).*>(.*</script>)|<!-- Squished Twitter Object -->|sigU
Your help, for a better code, is deeply appreciated.
Edit: Not f'd — you won't find me on Facebook fsf.org/fb (Just for fun xD)
s|<a [^>]*(sharer.php).*>(.*</a>)|<a href="http://www.fsf.org/fb"><img src="http://img804.imageshack.us/img804/7822/dislike50.png" alt="Not f'd" /></a>|sigU