Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Opera extension source added.

  • Loading branch information...
commit 461cd513eaddcf719f81e02e17eb0ffecbfb4b88 1 parent dbb5778
@alexrubin authored
View
9 opera/source/config.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<widget xmlns="http://www.w3.org/ns/widgets" id="extensions:FacebookBlocker" version="0.5">
+ <name>Facebook Blocker</name>
+ <description>Block Facebook content from appearing on other websites.</description>
+ <author href="http://webgraph.com/resources/facebookblocker">Webgraph, Inc. (@facebookblocker)</author>
+ <icon src="icons/icon-128.png"/>
+ <update-description href="http://test.opera.com/api/w3c-wd1/update/opera-configurator-1.0-1/"/>
+</widget>
View
BIN  opera/source/icons/icon-128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
22 opera/source/includes/fbblock.js
@@ -0,0 +1,22 @@
+// ==UserScript==
+// @name Facebook Blocker
+// @author J. King & Dustin Wilson
+// @version 1.
+// @description Removes annoying Facebook garbage from websites.
+// @exclude http://*.facebook.*/*
+// ==/UserScript==
+
+window.opera.addEventListener('BeforeScript',function(ev)
+{
+ if(ev.element.src.match(/^https?:\/\/(?:[^\/]+\.)*(?:facebook|fbcdn|fbshare)\.[^\/]+\//))
+ ev.preventDefault();
+},false);
+
+//There will be a flash of content sometimes before loading. This is unavoidable because Opera starts loading before the DOM tree is finished construction in an attempt to perhaps get relevant information to the user more quickly.
+window.opera.addEventListener('BeforeEvent.load',function(ev)
+{
+ var element=ev.event.target;
+
+ if(element.nodeName=='IFRAME' && element.src.match(/^https?:\/\/(?:[^\/]+\.)*(?:facebook|fbcdn|fbshare)\.[^\/]+\//))
+ element.parentNode.removeChild(element);
+},false);
View
0  opera/source/index.html
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.