Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix regex replace bug. adding ajax/page content change sniffer. updat…

…ing manifests. adding mccoy updatekey to firefox
  • Loading branch information...
commit 1b7f8e6524c6f4a7ecd29ec87f641545ce295123 1 parent b442ca2
@gleuch authored
View
2  chrome/manifest.json
@@ -17,5 +17,5 @@
"name": "Tinted Sheen Blocker",
"permissions": [ "tabs", "http://*/*" ],
"update_url": "http://addons.gleuch.com/tinted-sheen/updates/chrome?data=",
- "version": "1.0.0"
+ "version": "1.0.1"
}
View
31 chrome/tinted-sheen.js
@@ -36,7 +36,7 @@ function tinted_sheen_start($_) {
};
$_.extend($_.tinted_sheen, {
- settings : {hide_bg : true, search: /(charlie(\s|\-|\_)?)?(sheen|porn\sfamily|\#winning|\#tigerblood)/img, replace: '<span class="tinted_sheen" style="color: %C; background-color: %C;">$1$2$3$4$5</span>', starred: '****** ******', init : false, finish : false},
+ settings : {hide_bg : true, href : false, page_height : 0, search: /(charlie(\s|\-|\_)?)?(sheen|porn\sfamily|\#winning|\#tigerblood|tiger\sblood|adonis\sdna|\#sheenskorner|sheen\'s\skorner|\#fastball)/img, replace: '<span class="tinted_sheen" style="color: %C; background-color: %C;">$1$2$3</span>', starred: '****** ******', init : false, finish : false},
pluck : function(str) {return str.replace(/(charlie\s)(sheen)/img, '****** ******').replace(/(sheen|\#winning)/img, '******');},
@@ -78,10 +78,12 @@ function tinted_sheen_start($_) {
$_(document).each(function() {this.title = $_.tinted_sheen.pluck(this.title);});
$_('img, input[type=image]').each(function() {
- if ($_(this).attr('alt').match($_.tinted_sheen.settings.search) || $_(this).attr('title').match($_.tinted_sheen.settings.search) || $_(this).attr('src').match($_.tinted_sheen.settings.search)) {
- var r = $_(this), w = r.width(), h = r.height(), c = rgb2hex($_(this).css('color'));
- r.css({background: c, width: r.width(), height: r.height()}).attr('src', 'http://assets.gleuch.com/blank.png').width(w).height(h);
- }
+ try {
+ if ($_(this).attr('alt').match($_.tinted_sheen.settings.search) || $_(this).attr('title').match($_.tinted_sheen.settings.search) || $_(this).attr('src').match($_.tinted_sheen.settings.search)) {
+ var r = $_(this), w = r.width(), h = r.height(), c = rgb2hex($_(this).css('color'));
+ r.css({background: c, width: r.width(), height: r.height()}).attr('src', 'http://assets.gleuch.com/blank.png').width(w).height(h);
+ }
+ } catch(e) {}
});
$_('input[type=text]').each(function() {if ($_(this).val().match($_.tinted_sheen.settings.search) ) $_(this).val( $_.tinted_sheen.pluck($_(this).val()) );});
@@ -91,12 +93,28 @@ function tinted_sheen_start($_) {
s.innerHTML = ".tinted_sheen {font-size: inherit !important; "+ ($_.tinted_sheen.settings.hide_bg ? "background-image: none !important;" : "") +"} .bg_tinted_sheen {"+ ($_.tinted_sheen.settings.hide_bg ? "background-image: none !important;" : "") +"}";
$_('head').append(s);
+ $_.tinted_sheen.settings.href = location.href;
+ $_.tinted_sheen.settings.page_height = $_('body').height();
+
$_.tinted_sheen.settings.finish = true;
}
});
})($_);
$_.tinted_sheen('body', '#000000');
+
+ /* Allow AJAX detection */
+ setInterval(function() {
+ var h = $_('body').height(), ch = $_.tinted_sheen.settings.page_height;
+
+ if (location.href != $_.tinted_sheen.settings.href || Math.abs(ch-h) > 20 ) {
+ $_.tinted_sheen.settings.href = location.href;
+ $_.tinted_sheen.settings.page_height = h;
+ $_.tinted_sheen.settings.init = false;
+ $_.tinted_sheen.settings.finish = false;
+ $_.tinted_sheen('body', '#000000');
+ }
+ }, 1000);
}
@@ -110,5 +128,4 @@ try {
jQuery('body').addClass('tigerblood');
tinted_sheen_start(jQuery);
}
-} catch(err) {
-}
+} catch(err) {}
View
31 firefox/content/tinted-sheen.js
@@ -4413,7 +4413,7 @@ function tinted_sheen_start($_) {
};
$_.extend($_.tinted_sheen, {
- settings : {hide_bg : true, search: /(charlie(\s|\-|\_)?)?(sheen|porn\sfamily|\#winning|\#tigerblood)/img, replace: '<span class="tinted_sheen" style="color: %C; background-color: %C;">$1$2$3$4$5</span>', starred: '****** ******', init : false, finish : false},
+ settings : {hide_bg : true, href : false, page_height : 0, search: /(charlie(\s|\-|\_)?)?(sheen|porn\sfamily|\#winning|\#tigerblood|tiger\sblood|adonis\sdna|\#sheenskorner|sheen\'s\skorner|\#fastball)/img, replace: '<span class="tinted_sheen" style="color: %C; background-color: %C;">$1$2$3</span>', starred: '****** ******', init : false, finish : false},
pluck : function(str) {return str.replace(/(charlie\s)(sheen)/img, '****** ******').replace(/(sheen|\#winning)/img, '******');},
@@ -4455,10 +4455,12 @@ function tinted_sheen_start($_) {
$_(document).each(function() {this.title = $_.tinted_sheen.pluck(this.title);});
$_('img, input[type=image]').each(function() {
- if ($_(this).attr('alt').match($_.tinted_sheen.settings.search) || $_(this).attr('title').match($_.tinted_sheen.settings.search) || $_(this).attr('src').match($_.tinted_sheen.settings.search)) {
- var r = $_(this), w = r.width(), h = r.height(), c = rgb2hex($_(this).css('color'));
- r.css({background: c, width: r.width(), height: r.height()}).attr('src', 'http://assets.gleuch.com/blank.png').width(w).height(h);
- }
+ try {
+ if ($_(this).attr('alt').match($_.tinted_sheen.settings.search) || $_(this).attr('title').match($_.tinted_sheen.settings.search) || $_(this).attr('src').match($_.tinted_sheen.settings.search)) {
+ var r = $_(this), w = r.width(), h = r.height(), c = rgb2hex($_(this).css('color'));
+ r.css({background: c, width: r.width(), height: r.height()}).attr('src', 'http://assets.gleuch.com/blank.png').width(w).height(h);
+ }
+ } catch(e) {}
});
$_('input[type=text]').each(function() {if ($_(this).val().match($_.tinted_sheen.settings.search) ) $_(this).val( $_.tinted_sheen.pluck($_(this).val()) );});
@@ -4468,12 +4470,28 @@ function tinted_sheen_start($_) {
s.innerHTML = ".tinted_sheen {font-size: inherit !important; "+ ($_.tinted_sheen.settings.hide_bg ? "background-image: none !important;" : "") +"} .bg_tinted_sheen {"+ ($_.tinted_sheen.settings.hide_bg ? "background-image: none !important;" : "") +"}";
$_('head').append(s);
+ $_.tinted_sheen.settings.href = location.href;
+ $_.tinted_sheen.settings.page_height = $_('body').height();
+
$_.tinted_sheen.settings.finish = true;
}
});
})($_);
$_.tinted_sheen('body', '#000000');
+
+ /* Allow AJAX detection */
+ setInterval(function() {
+ var h = $_('body').height(), ch = $_.tinted_sheen.settings.page_height;
+
+ if (location.href != $_.tinted_sheen.settings.href || Math.abs(ch-h) > 20 ) {
+ $_.tinted_sheen.settings.href = location.href;
+ $_.tinted_sheen.settings.page_height = h;
+ $_.tinted_sheen.settings.init = false;
+ $_.tinted_sheen.settings.finish = false;
+ $_.tinted_sheen('body', '#000000');
+ }
+ }, 1000);
}
@@ -4487,5 +4505,4 @@ try {
jQuery('body').addClass('tigerblood');
tinted_sheen_start(jQuery);
}
-} catch(err) {
-}
+} catch(err) {}
View
6 firefox/install.rdf
@@ -4,12 +4,10 @@
<Description about="urn:mozilla:install-manifest">
<em:id>tinted-sheen@gleuch.com</em:id>
<em:name>Tinted Sheen Blocker</em:name>
- <em:version>1.0.0</em:version>
- <!--
+ <em:version>1.0.1</em:version>
<em:updateURL>http://addons.gleuch.com/tinted-sheen/updates/firefox</em:updateURL>
<em:updateInfoURL>http://addons.gleuch.com/tinted-sheen/updates/firefox/info</em:updateInfoURL>
- <em:updateKey></em:updateKey>
- -->
+ <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdaXt5MaiB3DdpsEhTagj5H/2Pd20zocVS1n/86uYswWF6pWxgx2X8fBkeujA6dmN0UIWVrLZLTFWwh6gQjsvpzxWMynRVkkx2JbMK0uuilaL6EO+MW6RNcHbLJrN2CCrYMwjTre/gruCWK63k/6wE4I2LT/O/vsmyobfYqvQ3CQIDAQAB</em:updateKey>
<em:creator>Greg Leuch</em:creator>
<em:contributor>Greg Leuch</em:contributor>
View
2  tinted-sheen.js
@@ -44,7 +44,7 @@ function tinted_sheen_start($_) {
};
$_.extend($_.tinted_sheen, {
- settings : {hide_bg : true, search: /(charlie(\s|\-|\_)?)?(sheen|porn\sfamily|\#winning|\#tigerblood)/img, replace: '<span class="tinted_sheen" style="color: %C; background-color: %C;">$1$2$3$4$5</span>', starred: '****** ******', init : false, finish : false},
+ settings : {hide_bg : true, search: /(charlie(\s|\-|\_)?)?(sheen|porn\sfamily|\#winning|\#tigerblood|tiger\sblood|adonis\sdna|\#sheenskorner|sheen\'s\skorner|\#fastball)/img, replace: '<span class="tinted_sheen" style="color: %C; background-color: %C;">$1$2$3</span>', starred: '****** ******', init : false, finish : false},
pluck : function(str) {return str.replace(/(charlie\s)(sheen)/img, '****** ******').replace(/(sheen|\#winning)/img, '******');},
Please sign in to comment.
Something went wrong with that request. Please try again.