New Content - Implemented Extra space in stationary buttons

Veracity

Developer
Staff member
This JUST started happening: after finishing a fight, the stationary buttons we have take up a whole bunch of extra lines before the end of combat text appears.

I just learned that KoL is now embedding Google ads below the CAB and above the text - for some accounts. Mine, it appears.

I don't see that, since I have AdBlocker; no malware injected onto MY computer by ads, thank you very much!

But I wonder if that is the issue?

If so, I am in favor of nuking ad/mal-ware, with prejudice, in the Relay Browser.

But, other opinions are welcome, as always.
 

Veracity

Developer
Staff member
OK, even though I logged out of G_D a month ago and haven't been back since, I decided to go take a look anonymously. There is, in fact, a thread about KoL serving Google ads just below the CAB. I don't see them, because I run Adblock. And what forced me to do that? The KoL Wiki.

A few years ago, after the Wiki started incorporating ads - which I found to be distracting and obnoxious and downright inappropriate, on occasion. Really? You are giving me animated ads to porn sites? - I went to the Wiki and it loaded an ad which took over my browser. It expanded the browser window to full screen and there was not a damned thing I could do to get out of it - until I forced a reload with the power button on my computer. Goodbye, unsaved work! I took a considerable amount of my precious time making sure that my computer was not infected, and before I went back to the Wiki, I installed AdBlock. Now, when I visit the Wiki, I see little notices asking me to disable it. No way, no how! You damaged my computer once and you will never, ever have the opportunity to do it again.

So, KoL has decided to insert ads - which AdBlock successfully removes for me - which take up space below where the CAB goes. That really screws up my experience with my Stationary buttons. I am inclined to do this:

If you run the CAB, live with it. This is the experience that KoL wants you have. So, enjoy it!

If you don't run the CAB, we insert KoLmafia Stationary buttons for you. As the first stage of processing the page for those, remove the ads. Then, insert the Stationary Buttons in the page. They will calculate the space they need based on the ad-free top part of the page and all will be as it was before.

Tell me why I shouldn't do this.
 

Bale

Minion
Tell me why I shouldn't do this.

Because KoL needs money to survive. Would it be possible to only remove the space if the ad isn't being blocked? That way people who aren't blocking ads will be able to see it? If what you are doing will allow the ad to load, but simply not show it to the user, that would be ideal. KoL gets the money and the users don't have to bother actually looking at it.

I'm actually kinda conflicted on the whole ad issue. On the forum I'm hearing so many horror stories about what google ads have done to people that I am very hesitant to unblock them even though I want to help KoL's finances. I wish there was a way that mafia could load those ads in a way that google pays KoL for, but prevent passing them on to the browser. Can that be done?
 

Veracity

Developer
Staff member
Oh, when we fetch the ad from KoL, that is "loading" the ad. The question is whether or not to pass it on down to the browser. Right now, we pass it on through and AdBlock kicks in and blanks it out, leaving the extra space which bugs me.

We can't stop KoL from serving ads. We CAN prevent them from being visible. I don't think sites that offer to serve ads get any revenue from doing that - only when the users actually click. If I am wrong and simply serving the ads is enough, cool; what I propose will not change anything. But if I am right, since many many people will not ever click on ads for any reason, all they accomplish is to alienate people.

Edit: actually, perhaps the ad includes javascript or something which will actually "load" the ad. I'll have to look at this tomorrow. I don't know, precisely, what it is that will "make money" for KoL. Perhaps we can "load" ads in a separate thread and simply discard them, or something.
 
Last edited:

Bale

Minion
As I understand it, just getting eyeballs on the ad will earn a tiny amount of money. If someone actually clicks on it the site earns a notably larger amount of cash. I am 95% sure that this is correct.


Perhaps we can "load" ads in a separate thread and simply discard them, or something.

That is an excellent idea. Though perhaps we should make that a preference controlled behavior since it alters the appearance of KoL.
 

Darzil

Developer
Personally the only thing I really hate about Ads (other than that they just get in the way, I've so far in my life clicked on one Ad deliberately, and didn't buy anything that time), is that the google ones don't tend to control what they do that well. I hate the ones in the kolmafia forum with a passion, though to be fair in the last couple of weeks I've only seen badly written scripts stop the browser, rather than redirect to other pages successively then display the right one (breaking back button). If they were just images that you could click on to take you somewhere, with no other active content, I'd be fine with them. With google ads some take minutes to load, which would kill KoL combat. I've never used an Ad blocker, because I feel that I should be contributing if people hosting the sites I use need that income. If the income was only on clicks through, though, I guess I could use Ad Blocker as I don't.

I am seeing some somewhat odd behaviour on Samuel Spade, who has never donated (though has a VIP key). When I look at combat I do see large white patches, though I have no ad blocking. The code is:
Code:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- ROS_728x90 -->
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-5904875379193204"
     data-ad-slot="3053908571"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br><img src=/images/otherimages/1x1trans.gif height=4><br>

The code of the Ad itself is :
Code:
<html><body style="background-color:transparent"></body></html>

However, it's only when running KoLmafia that I don't see them, when running in vanilla I do see them. I guess maybe google renders Ads based on referring URL, and from Mafia that is localhost or something?
 

lostcalpolydude

Developer
Staff member
First, since everyone using mafia missed seeing this, I think it's worth posting http://images.kingdomofloathing.com/otherimages/apology.gif for people to have the chance to read. (The initial main.php hit, which is necessary and KoL even goes to some effort to force it to happen now (redirecting adventure.php and I think some other pages if you haven't loaded main.php this session), loads that image, and it only shows up once ever for accounts now as far as I can tell.)

Without using mafia, on a test character, and disabling adblock to test it, I see a few ads, and then they stop showing up while the blank space remains.

Philosophical issues aside, it might be worth removing the ads completely for automated adventuring. Not to take money away from Jick, but to avoid any issues where it looks like bots are abusing the ad system and get Jick cut off for page loads that no human is going to see. I should probably find out if that's something he would want at least.
 
Last edited:

Veracity

Developer
Staff member
Looking at what Darzil posted, it is asking the Browser to download Javascript from google and execute it. Well, that kills my idea of stripping out ads and "loading" them in a thread; we could download the remote .js, but no way are we going to execute it. I'm curious to see it. I assume that it, in turn, somehow uses the "data-ad-client" and "data-ad-slot" to download another specific file. Well, maybe we could do that. Only in the Relay Browser, of course.

Philosophical issues aside, it might be worth removing the ads completely for automated adventuring.
I don't know what you mean by this. For automated adventuring, we request the initial page (adventure.php), follow redirects to fight.php or choice.php, and will load api.php if the page asks for charpane.php. We do absolutely nothing with any other links on the page, and we certainly make no attempt to evaluate any embedded JavaScript.

The only time ads actually get loaded is when the Relay Browser sends the page down to the user's browser, which executes the JavaScript and fetches whatever.
 
To emphasize lostcalpolydude's point, please be careful that whatever behavior is introduced (or currently exists, for that matter) doesn't get seen as an ad-abusive bot. Loading and discarding ads without presenting them, for example, or anything else that fakes a user's eyes / clicks. This may take a bit of coordination with Asym. And / or looking into Google's TOS on this (it's been some years since I've needed to do that).

I wouldn't want to see KOLMafia running afoul of KOL over the new ads somehow. It sounds like current behavior is ok (pass through to relay, ignore if automated), other than the layout issue. Acting as an ad-blocker (with opt-in/out) is probably also ok.

I only have the one donating account, so I don't see what's going on with ads. It sounds as if the issue might also be at least partially on the KOL implementation side, which might merit a bug report there.
 

Darzil

Developer
I wouldn't want to see KOLMafia running afoul of KOL over the new ads somehow. It sounds like current behavior is ok (pass through to relay, ignore if automated), other than the layout issue. Acting as an ad-blocker (with opt-in/out) is probably also ok.
I'm not sure what is going on with the relay, as whilst the code comes through, the adverts aren't. We might need to ask TPTB which servers are registers as referrers for adverts, maybe http(s)://www.kingdomofloathing.com/game is the wrong referrer to use, which is why the adverts aren't showing.
 

roippi

Developer
I'll wax philosophical for a second.

I see a significant parallel here to our policy on server hits. Admittedly there is likely some self-preservation behind that policy - if mafia abused KoL's servers, we'd incur the direct wrath of TPTB - but also some altruism. Server hits cost TPTB money - anything we can do to save them a buck here and there will add up in the long run.

So I think we should take this matter very seriously. It clearly deeply hurt Jick to start running ads, so we should give him the benefit of the doubt and Do What We Can to see that mafia users generate a proportionate amount of ad revenue. I'm certainly not saying that we should *force* ads upon users any more than a vanilla browser does - just that we give our users the opportunity to see them just as they would in a regular browser. If users want to run adblock that should work as well.
 

Veracity

Developer
Staff member
I do run AdBlock - and, after my experience with Coldfront serving me malware which forced me to do a hard system reset to get my computer back, there is no way in hell I will turn it off for anybody whatsoever who is actually serving ads. I use my computer for my job. I simply cannot risk having it compromised. The problem is, KoL reserves enough space to show the ad, whether or not AdBlock decides to suppress it, and I end up with a degraded KoL experience.

I propose the following:

- Apparently, if you run KoLmafia, even with AdBlock disabled, you don't see the ads. Just the space where they would go. Perhaps that is because we munge the referrer and Google doesn't get what it expects. We should investigate and fix that. That is the Do What We Can part of your recommendation.

- We should have an opt-in way to, essentially, be "smart" AdBlock and not only strip out the Javascript to fetch the ad, but also remove the block of space that is reserved to show the ad. And that goes beyond "if users want to run adblock that should work" because, as I pointed out, "running adblock" is not enough; the way KoL has decided to show the ads, they intrude, whether or not you can actually see the ad itself.

I have started an experimental patch to do that. I have a preference - suppressPotentialMalware - which controls whether the Relay Browser removes the ad. I'll get it working tomorrow, I assume, on one of my multis who has not directly donated.
 

lostcalpolydude

Developer
Staff member
If it's something that only shows up with CAB not enabled, then that sounds like a KoL bug. I only see the blank space with no ad after playing through a few turns (so the ads are just finished), or when using mafia on a character that would normally have ads, but I never tested with the CAB off.

Doing a quick check with the CAB off for a character that isn't getting ads, I don't see any extra space there either.
 

Veracity

Developer
Staff member
When I saw this today, it was on a multi with the CAB disabled. I automated some number of turns and then went to the Relay Browser to fetch a semirare - and the Stationary Button at the top for "again" was there, along with an inch of blank space underneath. I had no idea what that was, and only later suspected it was a suppressed ad.

I will run tomorrow with debug logging and will look at what KoL sends, what we relay to the browser, and my eyes will tell me what is actually displayed.
 

roippi

Developer
I do run AdBlock - and, after my experience with Coldfront serving me malware which forced me to do a hard system reset to get my computer back, there is no way in hell I will turn it off for anybody whatsoever who is actually serving ads. I use my computer for my job. I simply cannot risk having it compromised. The problem is, KoL reserves enough space to show the ad, whether or not AdBlock decides to suppress it, and I end up with a degraded KoL experience.

I propose the following:

- Apparently, if you run KoLmafia, even with AdBlock disabled, you don't see the ads. Just the space where they would go. Perhaps that is because we munge the referrer and Google doesn't get what it expects. We should investigate and fix that. That is the Do What We Can part of your recommendation.

- We should have an opt-in way to, essentially, be "smart" AdBlock and not only strip out the Javascript to fetch the ad, but also remove the block of space that is reserved to show the ad. And that goes beyond "if users want to run adblock that should work" because, as I pointed out, "running adblock" is not enough; the way KoL has decided to show the ads, they intrude, whether or not you can actually see the ad itself.

I have started an experimental patch to do that. I have a preference - suppressPotentialMalware - which controls whether the Relay Browser removes the ad. I'll get it working tomorrow, I assume, on one of my multis who has not directly donated.

Full agreement.
 

Veracity

Developer
Staff member
I only see the blank space with no ad after playing through a few turns (so the ads are just finished)...
Oh, so you see ads, and then when "the ads are just finished", you see a blank space big enough for an ad?

In that case, I guess we are not unintentionally blocking ads, but the KoL bug is that it asks for Google's Javascript - and/or reserves space for an ad even after it has decided to stop giving you ads for the day.

I don't mind the concept of my Stationary buttons with an ad below them (except that I do not trust ads), but I really do mind having a KoL provided blank space when no ad is intended.
 

lostcalpolydude

Developer
Staff member
I get that result when not using mafia (made a completely new character to test it). When using mafia, even the initial ads are blocked with a blank space still there.
 

Veracity

Developer
Staff member
OK. I'll see if I can figure out what we are doing to make the real ads not get shown.

Can you report the bug via dev about a blank space still being reserved even when the ads for the day are done?

Thanks.
 
Top