Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: includes/cssFilter.js

Issue 8482159: Initial element hiding functionality (Closed)
Patch Set: Created Oct. 9, 2012, 10:42 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: includes/cssFilter.js
===================================================================
deleted file mode 100644
--- a/includes/cssFilter.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// ==UserScript==
-// @include *
-// ==/UserScript==
-
-opera.extension.onmessage = function (event) {
- //opera.postError('INJECTED: got a ' + event.data.request + ' request for ' + document.location.href);
- if(event.data.request == 'css') {//Ensure the received message is for the right URL
- var css = document.getElementById(event.data.id);
- if(!css) {
- css = document.createElement('style');
- css.setAttribute('type', 'text/css');
- css.setAttribute('id', event.data.id);
- css.setAttribute('class', 'OAB'); //To allow easy removal by the user to view the original source code
- css.appendChild(document.createTextNode(event.data.reply));
- try {
- document.getElementsByTagName('html')[0].getElementsByTagName('head')[0].appendChild(css); //Only append if the file is an HTML file
- //opera.postError('INJECTED: CSS added - ' + event.data.id);
- }
- catch(e) {}
- }
- else {
- css.innerHTML = event.data.reply;
- //opera.postError('INJECTED: CSS updated - ' + event.data.id);
- }
- }
- else if(event.data.request == 'ping') {
- if(event.data.type == 'css')
- event.source.postMessage({request: 'css', url: document.location.href});
- }
-};
-
-opera.extension.postMessage({request: 'css', url: document.location.href});

Powered by Google App Engine
This is Rietveld