R2D221
|
|
March 28, 2015, 02:18:54 PM |
|
This is awesome. Too bad I can't use it on my mobile I though it can work to mobile too since I'm still not try it Thanks for a new update..everything works perfect It can't work on Windows Phone because it doesn't have addons.
|
An economy based on endless growth is unsustainable.
|
|
|
grue (OP)
Legendary
Offline
Activity: 2058
Merit: 1434
|
|
March 28, 2015, 04:08:31 PM |
|
You can theoretically get it to work by using a proxy that inserts the javascript into every page that you load. I'm planning on implementing a bitcointalk proxy with 2-factor authentication and other security features, so there's that
|
|
|
|
Mitchell
Staff
Legendary
Offline
Activity: 4060
Merit: 2256
Verified awesomeness ✔
|
|
March 28, 2015, 04:26:27 PM |
|
You can theoretically get it to work by using a proxy that inserts the javascript into every page that you load. I'm planning on implementing a bitcointalk proxy with 2-factor authentication and other security features, so there's that Sign me up! That is extremely handy.
|
| | | . Duelbits | | | ▄████▄▄ ▄█████████▄ ▄█████████████▄ ▄██████████████████▄ ▄████▄▄▄█████████▄▄▄███▄ ▄████▐▀▄▄▀▌██▄█▄██▐▀▄▄▀▌███ ██████▀▀▀▀████▀███▀▀▀▀█████ ▐████████████■▄▄▄■██████████▀ ▐██████████████████████████▀ ██████████████████████████▀ ▀███████████████████████▀ ▀███████████████████▀ ▀███████████████▀ | | | | | . ▄ ▄▄▀▀▀▀▄▄ ▄▀▀▄ █ █ ▀▄ █ ▄█▄ ▀▄ █ ▄▀ ▀▄ ▀█▀ ▄▀ ▀█▄▄▄▀▀ ▀ ▄▀ ▄▀ ▄▀
Live Games | | ▄▄▀▀▀▀▀▀▀▄▄ ▄▀ ▄▄▀▀▀▀▀▄▄ ▀▄ ▄▀ █ ▄ █ ▄ █ ▀▄ █ █ ▀ ▀ █ █ ▄▄▄ █ ▀▀▀▀▀▀▀▀▀▀▀▀▀ █ █ █ █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█ █▄█ █ ▀▀█ ▀▀█ ▀▀█ █ █▄█
Slots | | . ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄ █ ▄▄ █ ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄ █ █ ▄▄ █ █ █ █ █ █ ▄▀▀▄▀▀▄ █ █ █ ▀▄ ▄▀ █ █
Blackjack | | | | █▀▀▀▀▀█▄▄▄ ▀████▄▄ ██████▄ ▄▄▄▄▄▄▄▄█▀ ▀▀█ ████████▄ █ █████████▄ █ ██████████▄ ▄██ █████████▀▀▀█▄▄████ ▀▀███▀▀ ████ █ ███ █ █▀ ▄█████▄▄▄ ▄▄▀▀ ███████▀▀▀ | | | | | | | | | | [ Đ ][ Ł ] AVAILABLE NOW | |
Advertisements are not endorsed by me.
|
|
|
R2D221
|
|
March 28, 2015, 04:31:22 PM |
|
You can theoretically get it to work by using a proxy that inserts the javascript into every page that you load. I'm planning on implementing a bitcointalk proxy with 2-factor authentication and other security features, so there's that Yes, that would be nice, as long as it's secure.
|
An economy based on endless growth is unsustainable.
|
|
|
|
master-P
|
|
April 07, 2015, 12:44:40 AM |
|
Neat tool, nice to have. Personally I never really minded the sig ads that much. I am more bothered by the low quality/irrelevant/spammy posts that the sig ads/campaigns unintentionally promote to these forums.
|
|
|
|
Hueristic
Legendary
Offline
Activity: 3962
Merit: 5373
Doomed to see the future and unable to prevent it
|
|
April 07, 2015, 03:07:32 AM |
|
Neat tool, nice to have. Personally I never really minded the sig ads that much. I am more bothered by the low quality/irrelevant/spammy posts that the sig ads/campaigns unintentionally promote to these forums.
When I decide whether to ignore someone the Sig can be the deciding factor.
|
“Bad men need nothing more to compass their ends, than that good men should look on and do nothing.”
|
|
|
sed
|
|
April 07, 2015, 05:58:34 AM |
|
I don't trust your js code. It's non human readable.
Share original source code.
Uh, there's no such thing as compiled javascript (I know someone will correct me if I'm wrong), so I have to wonder what the hell you're talking about here. I feel like we are treading on thin ice here. Our forum is so unique and we created system of direct advertising method that is unprecedented and truly "sui generis". Yet you want to destroy that system by creating tools and methods which will disable signatures permanently? Potentially it can bring an end to all signature campaigns.
The forum isn't about advertising, its about discussion. Businesses that advertise in people's signatures have the same right to be here and the same right to be kicked out if they are disruptive. If individuals want to opt out of seeing advertisements they are more than welcome to, and if that brings down paid advertising signatures, then so be it. But I agree, great job grue. Indeed, I appreciate the approach here, people taking control to limit what they want to see, obviously this is a win. If advertizers annoy, they should be punished by people ignoring them. That will teach them to annoy less. Ie, be less distracting. Wil I be shot for irony if I try this script myself?
|
|
|
|
redsn0w
Legendary
Offline
Activity: 1778
Merit: 1043
#Free market
|
|
April 07, 2015, 08:50:41 AM |
|
Can I ask if there will be the possibility to integrate that script here in this forum (without using an external extension)? Thanks for the attention.
|
|
|
|
grue (OP)
Legendary
Offline
Activity: 2058
Merit: 1434
|
|
April 07, 2015, 04:37:34 PM |
|
Can I ask if there will be the possibility to integrate that script here in this forum (without using an external extension)? Thanks for the attention.
One way would be to create a forum theme that contains my script. That way it's available to every user and can be enabled/disabled from the user control panel. You'll have to petition theymos to do that though. Another way (which I mentioned before), would be to use a proxy that injects the script.
|
|
|
|
dserrano5
Legendary
Offline
Activity: 1974
Merit: 1029
|
|
April 07, 2015, 08:49:14 PM |
|
I don't trust your js code. It's non human readable.
Share original source code.
Uh, there's no such thing as compiled javascript (I know someone will correct me if I'm wrong), so I have to wonder what the hell you're talking about here.+ Not compiled but minified, which makes it harder to follow. He's asking for the non-minified version.
|
|
|
|
TheRealSteve
|
|
April 08, 2015, 03:19:54 AM |
|
If you cannot read this, original source code wont change anything! That's a wee bit unfair - Just because somebody doesn't know what to make of... $(e).find("a").length && (r *= 2) ...doesn't mean they won't know what this does: if ($(element).find("a").length > 0) { score = score * 2 } And the minified code - though possibly even the input - makes use of quite a few such tricks and programmer shorthands. refactored+annotated (making no claim that it still works, or even that I got it right - I certainly wouldn't use it): http://pastebin.com/CTXaCnkpBut for most people with concerns, this is the only bit of code that does anything they should care about: $(i[a]).attr("style", "opacity: 0; pointer-events: none") All it does is make the entire signature fully transparent and unresponsive to clicks/taps, and that bit of code is only called if the signature scores badly. There's certainly no communication with a mothership or secret background bitcoin mining on your CPU etc. going on. (as of this post)
|
|
|
|
grue (OP)
Legendary
Offline
Activity: 2058
Merit: 1434
|
|
April 08, 2015, 04:44:28 AM Last edit: April 08, 2015, 05:17:09 AM by grue |
|
If you cannot read this, original source code wont change anything! That's a wee bit unfair - Just because somebody doesn't know what to make of... $(e).find("a").length && (r *= 2) ...doesn't mean they won't know what this does: if ($(element).find("a").length > 0) { score = score * 2 } And the minified code - though possibly even the input - makes use of quite a few such tricks and programmer shorthands. refactored+annotated (making no claim that it still works, or even that I got it right - I certainly wouldn't use it): http://pastebin.com/CTXaCnkpBut for most people with concerns, this is the only bit of code that does anything they should care about: $(i[a]).attr("style", "opacity: 0; pointer-events: none") All it does is make the entire signature fully transparent and unresponsive to clicks/taps, and that bit of code is only called if the signature scores badly. There's certainly no communication with a mothership or secret background bitcoin mining on your CPU etc. going on. (as of this post) Your annotated code is actually pretty close to the original source! The main reason I use mimify the script with uglifyjs is because it removes my debug statements, which there are a lot of. In the interest of openness, here is a version that has minimal uglification applied to it: bct_adblock.no_debug.js. The creation and upload of the not-so-minified version is built into my upload scripts so it should be up to date with any future updates. For reference, below is the original source, with debugging removed. If you want to understand how the script works, TheRealSteve is the way to go because it has annotations. function isAnnoyingCharacter(char) { var code = char.charCodeAt(); var ranges = [[0x2500, 0x256F], [0x2580, 0x259F], [0x25A0, 0x25FF], ]; for(var i = 0; i < ranges.length; i++) if(code > ranges[i][0] && code <= ranges[i][1]) return true; return false; }
function calculateAnnoyingCharacter(element) { var childNodes = Array.prototype.slice.call(element.childNodes); var result = childNodes.reduce( function(prev, current, index) { if(current.nodeType == 1) return prev + calculateAnnoyingCharacter(current); if(current.nodeType == 3) { var count = 0; for (c of current.nodeValue) if(isAnnoyingCharacter(c)) count++;
var size = Number(getComputedStyle(current.parentNode).fontSize.match(/(\d*(\.\d*)?)px/)[1]); return prev + size*size*count; } return prev; }, 0); return result; }
function getFormattingRate(context) { var result = 0; if(context.backgroundColor) return 1; if(context.fontSize >= 14) result += 0.05 + Math.max(0, (context.fontsize - 14)*0.03); if(context.color) result += 0.2; if(context.font) result += 0.03; if(context.underline) result += 0.02; if(context.bold) result += 0.04; if(context.table) result += 0.2; return Math.min(result, 1); }
function calculateFormattingScore(element, context) { var previousContext = context; if(typeof(context) === 'undefined') previousContext = context = {}; else context = $.extend({}, context);
if(element.style.fontSize && element.style.fontSize != "inherit") context.fontsize = Number(element.style.fontSize.match(/(\d+)pt/)[1]);
if(element.style.color && element.style.color != "inherit") context.color = true; if(element.style.backgroundColor && element.style.backgroundColor != "inherit") context.backgroundColor = true; if(element.style.fontFamily && element.style.fontFamily != "inherit") context.font = true; if(element.style.textDecoration.indexOf("underline") != -1) context.underline = true; if(element.tagName == "B") context.bold = true; if(element.tagName == "TABLE") context.table = true; var score = $(element).width() * $(element).height() * getFormattingRate(context) - $(element).width() * $(element).height() * getFormattingRate(previousContext);
var childNodes = Array.prototype.slice.call(element.childNodes); score += childNodes.reduce( function(prev, current, index) { if(current.nodeType == 1) return prev + calculateFormattingScore(current, context); return prev; }, 0); return score; }
function isAd(div) { var score = 0; score += calculateAnnoyingCharacter(div); score += calculateFormattingScore(div); score = Math.sqrt(score); if($(div).find("a").length) score *= 2; return score > 100; };
try { var signatures = $("div .signature"); for(var i = 0; i < signatures.length; i++) { if(isAd(signatures[i])) { $(signatures[i]).attr("style", "opacity: 0; pointer-events: none"); } } } catch(e) { console.log(e); }
|
|
|
|
Amph
Legendary
Offline
Activity: 3248
Merit: 1070
|
|
April 08, 2015, 07:53:29 AM |
|
too bad i don't like java, why not choosing other programming language? can this be done in php or python?
|
|
|
|
Mitchell
Staff
Legendary
Offline
Activity: 4060
Merit: 2256
Verified awesomeness ✔
|
|
April 08, 2015, 08:02:14 AM |
|
too bad i don't like java, why not choosing other programming language? can this be done in php or python?
This is not Java, this is Javascript.
|
| | | . Duelbits | | | ▄████▄▄ ▄█████████▄ ▄█████████████▄ ▄██████████████████▄ ▄████▄▄▄█████████▄▄▄███▄ ▄████▐▀▄▄▀▌██▄█▄██▐▀▄▄▀▌███ ██████▀▀▀▀████▀███▀▀▀▀█████ ▐████████████■▄▄▄■██████████▀ ▐██████████████████████████▀ ██████████████████████████▀ ▀███████████████████████▀ ▀███████████████████▀ ▀███████████████▀ | | | | | . ▄ ▄▄▀▀▀▀▄▄ ▄▀▀▄ █ █ ▀▄ █ ▄█▄ ▀▄ █ ▄▀ ▀▄ ▀█▀ ▄▀ ▀█▄▄▄▀▀ ▀ ▄▀ ▄▀ ▄▀
Live Games | | ▄▄▀▀▀▀▀▀▀▄▄ ▄▀ ▄▄▀▀▀▀▀▄▄ ▀▄ ▄▀ █ ▄ █ ▄ █ ▀▄ █ █ ▀ ▀ █ █ ▄▄▄ █ ▀▀▀▀▀▀▀▀▀▀▀▀▀ █ █ █ █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█ █▄█ █ ▀▀█ ▀▀█ ▀▀█ █ █▄█
Slots | | . ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄ █ ▄▄ █ ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄ █ █ ▄▄ █ █ █ █ █ █ ▄▀▀▄▀▀▄ █ █ █ ▀▄ ▄▀ █ █
Blackjack | | | | █▀▀▀▀▀█▄▄▄ ▀████▄▄ ██████▄ ▄▄▄▄▄▄▄▄█▀ ▀▀█ ████████▄ █ █████████▄ █ ██████████▄ ▄██ █████████▀▀▀█▄▄████ ▀▀███▀▀ ████ █ ███ █ █▀ ▄█████▄▄▄ ▄▄▀▀ ███████▀▀▀ | | | | | | | | | | [ Đ ][ Ł ] AVAILABLE NOW | |
Advertisements are not endorsed by me.
|
|
|
coinpr0n
|
|
April 08, 2015, 09:09:36 AM |
|
too bad i don't like java, why not choosing other programming language? can this be done in php or python?
This is not Java, this is Javascript. Either way, choose the best tool for the job. I know it's not, but even if it were Java, not "liking" something shouldn't be the disqualifying feature when it comes to choosing a development technology.
|
|
|
|
redsn0w
Legendary
Offline
Activity: 1778
Merit: 1043
#Free market
|
|
April 08, 2015, 09:32:32 AM |
|
Can I ask if there will be the possibility to integrate that script here in this forum (without using an external extension)? Thanks for the attention.
One way would be to create a forum theme that contains my script. That way it's available to every user and can be enabled/disabled from the user control panel. You'll have to petition theymos to do that though. Another way (which I mentioned before), would be to use a proxy that injects the script. Thanks for the reply, so we should open a thread and ask to theymos if he can add this script here in the forum. I think someone of us will do this (when it will be necessary). The second option is more "risky" than the first, or am I wrong? Maybe it is better the first option.
|
|
|
|
TheRealSteve
|
|
April 08, 2015, 10:28:49 AM |
|
Your annotated code is actually pretty close to the original source! sweet! Thanks for the reply, so we should open a thread and ask to theymos if he can add this script here in the forum. Keep in mind that if the javascript code is added to the forum, it also needs somebody to maintain it, and you can't make your own tweaks (e.g. to the scoring algorithm) I'm also not sure that's really the way to go versus a signature ignore boolean of some variety. There's pros and cons (dev time, upkeep, (false) positives, user control, server load, etc.) to both approaches though.
|
|
|
|
SirChiko
Legendary
Offline
Activity: 966
Merit: 1000
|
|
April 08, 2015, 11:13:31 AM |
|
However, was there not a option to disable all signatures?
Even If I'm sure you already know this: "Profile" -> "Look and Layout Preferences" -> "Don't show users' signatures." That isn't thr thing everyone wants. Me as an example, i want to see user signatures and most of other people want too, they just don't want to see the AD ones.
|
The only online casino on which i won something. I made 17mBTC from 1mBTC in like 15 minutes. This is not paid AD!
|
|
|
Hueristic
Legendary
Offline
Activity: 3962
Merit: 5373
Doomed to see the future and unable to prevent it
|
|
April 09, 2015, 04:06:57 AM |
|
One way would be to create a forum theme that contains my script. That way it's available to every user and can be enabled/disabled from the user control panel. You'll have to petition theymos to do that though.
If this was implemented then selective blocking could be used as well.
|
“Bad men need nothing more to compass their ends, than that good men should look on and do nothing.”
|
|
|
|