Page 1 of 2

Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Mon Jun 29, 2015 8:00 pm
by cmmc
Images are blocked when Addthis is blocked by RequestPolicy (but are still loaded and show briefly while page loads), but not if I Addthis is whitelisted. I'd like to block whatever script is hiding them, if possible.

Page: http://www.jn.pt/paginainicial/pais/con ... 25&page=-1

ABP filters active with RequestPolicy default permissions (Easylist, EasyPrivacy and Fanboy Annoyances):

Code: Select all

##a[href^="http://pubads.g.doubleclick.net/"]
/PbaSitetracker.js
/images/*_share.png
/images/rss_
/images/facebook
/images/*instagram.png
/rss.png
_social_tracking.
ABP filters active with Addthis whitelisted in RequestPolicy (same lists):

Code: Select all

##a[href^="http://pubads.g.doubleclick.net/"]
/addthis_widget.
||addthis.com^$third-party
/PbaSitetracker.js
/images/*_share.png
/images/rss_
/images/facebook
/images/*instagram.png
/rss.png
_social_tracking.
@@||s7.addthis.com*/addthis_widget.js*pubid=
Other sites possibly affected: dn.pt, ojogo.pt, voltaaomundo.pt, dinheirovivo.pt, acorianooriental.pt, dnoticias.pt, ocasiao.pt, tsf.pt, noticiasmagazine.pt, jornaldofundao.pt, globalimagens.pt and lojadojornal.pt (all part of the same group).

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Sun Jul 19, 2015 5:38 pm
by cmmc
Bump.

Like I said, images and videos are loaded and then hidden, but it's not just RequestPolicy, these filters from Fanboy's Annoyance list are also involved:

Code: Select all

/addthis_widget.
||addthis.com^$third-party
So what I'm looking for, if possible, is not to allow addthis on this page, but to block the script that's hiding its content.
http://www.jn.pt/PaginaInicial/Desporto ... id=4688516

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Sun Jul 19, 2015 5:47 pm
by mapx
these filters
/addthis_widget.
||addthis.com^$third-party

are blocking filters, so ..I don't understand what's your issue ? And what is about ...RequestPolicy ?!

Did you try keeping only 1 blocking extension (ABP) and test again ?

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Tue Jul 21, 2015 3:58 am
by cmmc
I know those are blocking filters, but the page content is being hidden after being loaded and briefly displayed, so what else is doing that and how can I stop it? Some other piece of code must be doing some checking and hiding the content when that fails - this is what I want to block.

Yes, I still need to disable those filters in ABP.

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Tue Jul 21, 2015 9:26 am
by mapx
Did you try disabling all other addons ? (requestpolicy, other)

submit an issue report (keeping disabled all other addons). Post here the report link.

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Tue Jul 21, 2015 11:19 pm
by cmmc
Report: https://reports.adblockplus.org/88a66ad ... b94c8c4fde

It seems the issue comes from the site itself, jn.pt, not from a third-party script.

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Tue Jul 21, 2015 11:28 pm
by mapx
I have no issues, the images are displayed (slide show images).
You have a lot of addons (better privacy also which could block something).
Disable all of them and repeat your test. Keep only ABP.

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Tue Jul 21, 2015 11:50 pm
by cmmc
https://reports.adblockplus.org/1101637 ... 9ad110a2ba

All disabled; still happens.

btw, 'Mark the problem' button doesn't do anything.

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Tue Jul 21, 2015 11:59 pm
by mapx
I can reproduce the issue only in firefox, chrome is ok

You need this filter

Code: Select all

@@/addthis_widget.js$domain=jn.pt
I reported on easylist forum
https://forums.lanik.us/viewtopic.php?f=64&t=24183

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Wed Jul 22, 2015 12:27 am
by cmmc
Thanks, that should expected, since disabling those filters, solved the problem.

But is it possible to identify (and possibly block) the script that's verifying whether addthis is loaded or not? When the scripts from jn.pt are blocked by NoScript, this problem doesn't happen, so some script from that address, for some odd reason (apparently blocking all other third-party content doesn't seem to be a problem for them, only that one) must be checking what's being loaded and saying 'no soup for you' if addthis isn't loaded. Problem is blocking that address also blocks page formatting.

Any pointers on what to look for?

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Wed Jul 22, 2015 12:41 am
by cmmc
Ok, used Inspect Element to look into that portion of the code and found this:

Code: Select all

<script type="text/javascript">
    
 if($(".galleria").length > 0)
  {
	 



		Galleria.loadTheme('/common/script/galleria/galleria.azur.min.js');

		// Initialize Galleria
		var previousImg = -1;
		var startupImg = true;
		
		var ImagesHeight = 0;
		var ImagesWidth = 0;
		
		var firstLoad = true;
		
		Galleria.run('.galleria', {
		  imageCrop: false,
		  height: 560,//$(window).height() - $(".galleria").offset().top,
		  width:660,
		  transitionSpeed: 20,
		  showCounter: false,
		  
		  responsive: false,
		  debug:false,
		  dummy:"http://cdn.controlinveste.pt/jn/common/images/JN_DEFAULT_IMG.jpg",
		  dataConfig: function (img) {
			 var date = $(img).attr("date");
			 var title = $(img).attr("title");
			 var credits = $(img).attr("credits");
			 var position = $(img).attr("position");
			 var total = $(img).attr("total");
	
			 var width_win = $(window).width()-145;
			 var style_1 = "width:85%;"// + width_win +"px";
			 var classname = changestyle(title, 150);
	
			 var html = "<div style='"+style_1+"' class='text_photo'><div style='display:table-cell;vertical-align:middle;'><span class='span_number'>" + position + "/" + total + "</span>";
			 html += "<span class='span_pipe'>|</span>";
			 html += "<span class='span_date'>"+ date + "</span>";
			 html += "<span class='span_credits'>" + credits + "</span>";
			 html += "<div class='title_credits'><span class='span_title'>" + title + "</span></div></div></div>";
			 html += "<div class='fullscreen_button' onclick='fullscreen();'></div>";
			 html += "<div class='play' onclick='play();'></div>";

			 return {
				title: html
			 };
		  },
		  extend: function (options) {
			 this.bind('image', function(e) {
				//console.log("image");
				
				if (!firstLoad && !this._playing) 
				{
				  pgviewrefresh();
				 $("#ifPubRefresh").attr("src","/common/services/pubMrec.aspx?seccao=desporto_noticias");
				}
				
				firstLoad = false;
			 });
			 
			 this.bind("loadfinish", function (e) {
			 
				//console.log("loadfinish");
				//$(".galleria-stage img").css("height",$(".galleria-stage").height() - 37);
				//$(".galleria-image img[height='511']").css("height",$(".galleria-stage").height() - 37);
				
				//$(".galleria-stage img").css("height",$(".galleria-stage").height() - 37).css("width",($(this).width() * 445) / 482);
			 
				if (is_playing) {
				  $(".play").addClass("pause");
				}
				else
				  $(".play").removeClass("pause");
				  
				
			 });
			 
			 this.bind("fullscreen_exit",function(e){
				$(".fullscreen_button_active").addClass("fullscreen_button").removeClass("fullscreen_button_active");
				fullscreen_active = false;
				//pgviewrefresh();
				
				
				window.setTimeout(function(){
				  //$(".galleria-stage img").css("height",$(".galleria-stage").height() - 37);
				},200);
				  
			});
			 
			 this.bind('fullscreen_enter', function(e) {
				//pgviewrefresh();
				
				window.setTimeout(function(){
				  //$(".galleria-stage img").css("height",$(".galleria-stage").height() - 37);
				},200);
			 });
		  }
		});
	}
		var fullscreen_active = false;
		var is_playing = false;
		var is_pause = false;

		function fullscreen() {
		  if (fullscreen_active) {
			 $(".galleria-fullscreen").click();
		  }
		  else {
			 fullscreen_active = true;
			 
			 $(".galleria-fullscreen").click();
			 //$(".galleria-bar").show();
			 $(".fullscreen_button").addClass("fullscreen_button_active").removeClass("fullscreen_button");
		  }
		}

		function thumbs() {
		  if ($(".galleria-bar").is(":visible")) {
			 $(".galleria-bar").hide();
			 $(".galleria-container").css("background", "none");
			 $(".thumbs_chosen").addClass("thumbs").removeClass("thumbs_chosen");
		  }
		  else {
			 $(".galleria-bar").show();
			 $(".galleria-container").css("background", "black");
			 $(".thumbs").addClass("thumbs_chosen").removeClass("thumbs");
		  }
		}

		function play() {
		  if (is_playing) {
			 $(".galleria-bar .pause").click();
			 $(".play").removeClass("pause");
			 is_playing = false;
		  }
		  else {
			 $(".galleria-play").click();
			 $(".play").addClass("pause");
			 is_playing = true;
		  }
		}
		
		function changestyle(t, l)
		{
		  if(t != null && t != undefined && t.length > l)
		  {
			 var leng = 0;
			 var textSplit = t.split(" ");
			 var newText = "";
	 
			 return 'margin-top:-5px';
		  }
		  else
			 return '';
		}

  </script>
And, though not being a programmer I'm kind of clueless, it seems it's this portion that's the culprit:

Code: Select all

		  extend: function (options) {
			 this.bind('image', function(e) {
				//console.log("image");
				
				if (!firstLoad && !this._playing) 
				{
				  pgviewrefresh();
				 $("#ifPubRefresh").attr("src","/common/services/pubMrec.aspx?seccao=desporto_noticias");
				}
				
				firstLoad = false;
			 });
			 
			 this.bind("loadfinish", function (e) {
			 
				//console.log("loadfinish");
				//$(".galleria-stage img").css("height",$(".galleria-stage").height() - 37);
				//$(".galleria-image img[height='511']").css("height",$(".galleria-stage").height() - 37);
				
				//$(".galleria-stage img").css("height",$(".galleria-stage").height() - 37).css("width",($(this).width() * 445) / 482);
			 
				if (is_playing) {
				  $(".play").addClass("pause");
				}
				else
				  $(".play").removeClass("pause");
				  
				
			 });
Is that it - and is it something ABP can block?

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Wed Jul 22, 2015 12:42 am
by mapx
it happens only in firefox, so I guess it's not any script verifying but only a bad written site

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Wed Jul 22, 2015 12:44 am
by mapx
well, you have already the fix :) those probably are inline scripts which ABP can not block.

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Wed Jul 22, 2015 12:52 am
by cmmc
Ah, bummer that. Anyway, thanks, that fixed it.

Re: Images hidden at jn.pt (Addthis, RequestPolicy)

Posted: Sat Oct 17, 2015 9:15 pm
by cmmc
Sorry to bother you again with this, but it's still blocked (no other blocking extension used); if abp is disabled content displays normally.
http://www.jn.pt/paginainicial/pais/con ... 75&page=-1
Images are listed as hosted both in jn.pt/storage/ and static.globalnoticias.pt/storage/

The problem seems to be related with the slideshow player, as the image not in player display normally. Pages with a single image also load normally: http://www.jn.pt/PaginaInicial/Desporto ... 78&page=-1.

active filters:

easylist

Code: Select all

/ad-emea.
||pagefair.net^$third-party
||doubleclick.net/adj/$~object-subrequest,third-party
/pagead2.
||partner.googleadservices.com^$third-party
easyprivacy

Code: Select all

||pagefair.com^$third-party
||marktest.pt^$third-party
/PbaSitetracker.js
||webspectator.com^$third-party
||google-analytics.com/analytics.js
_social_tracking.
annoyances

Code: Select all

/images/*_share.png
/images/rss_
/images/facebook
/images/*instagram.png
/rss.png
third-party fonts:

Code: Select all

||fonts.googleapis.com/css?
custom filters

Code: Select all

||widget.engageya.com^$third-party
||e-goi.com^$third-party
||ocasiao.pt/banner/$subdocument
js.sl.pt/Snippets/SAS.js
@@/addthis_widget.js$domain=jn.pt