[ ijbswa-Actionsfile feedback-3601646 ] how to allow googleadservices from selected sites?

SourceForge.net <[email protected]>
Newsgroups gmane.comp.web.privoxy.devel
Message-ID <[email protected]>
Actionsfile feedback item #3601646, was opened at 2013-01-21 08:07
Message generated for change (Comment added) made by m_ardito
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=460288&aid=3601646&group_id=11118

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: filter: other problem
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: m.ardito (m_ardito)
Assigned to: Fabian Keil (fabiankeil)
Summary: how to allow googleadservices from selected sites?

Initial Comment:
how to allow googleadservices from selected sites?

hi i just want a favourite free software site heidisql.com to show its googleadservices ads (in the site's header) but my privoxy 3.0.19 is blocking it
i tried adding ".heidisql.com" and ".googleadservices.com" under allow-ads alias, and under a few others but can't make it work...

what is wrong? can't figure out


----------------------------------------------------------------------

>Comment By: m.ardito (m_ardito)
Date: 2013-01-25 04:28

Message:
also tried adding debug 64, nothing in the logs...

----------------------------------------------------------------------

Comment By: m.ardito (m_ardito)
Date: 2013-01-25 04:16

Message:
i activated debug 1024

and all i read is

2013-01-25 13:08:53.463 00001430 Crunch: Blocked:
http://pagead2.googlesyndication.com/pagead/show_ads.js
2013-01-25 13:08:53.651 00001734 Crunch: Blocked:
http://pagead2.googlesyndication.com/pagead/show_ads.js

which i expect to be rewritten by the filter... but the block persists

if i enable debug 1 and disable privoxy, reloading the page i see the ads
and get (some info snipped) in the log

2013-01-25 13:11:42.120 00001360 Request:
pagead2.googlesyndication.com/pagead/show_ads.js
2013-01-25 13:11:43.373 000016c4 Request: www.google.com/jsapi
2013-01-25 13:11:43.795 00000750 Request:
googleads.g.doubleclick.net/pagead/ads?client=ca-pub-[...snip...]
2013-01-25 13:11:43.819 00001108 Request:
pagead2.googlesyndication.com/pagead/osd.js
2013-01-25 13:11:43.820 00000efc Request:
www.google.com/uds/?file=visualization&v=1&packages=corechart
2013-01-25 13:11:45.142 000008e8 Request:
www.google.com/uds/api/visualization/1.0/[...snip...]/format+it,default,corechart.I.js
2013-01-25 13:11:56.348 00001600 Request:
weather29.sdcentral.net/weather2.asmx/weather_data_v2b?location=[...snip...]
2013-01-25 13:11:57.307 00001624 Request:
stardock.accuweather.com/widget/stardock/weather_data_v2b.asp?location=[...snip...]

----------------------------------------------------------------------

Comment By: Fabian Keil (fabiankeil)
Date: 2013-01-25 03:07

Message:
Try enabling logging as described at:
http://www.privoxy.org/user-manual/contact.html#CONTACT-BUGS
to check if the filter works as expected.

It's also possible that the filter works as expected and the request is no
longer blocked, but that the "adblocker detection" tests something else.

----------------------------------------------------------------------

Comment By: m.ardito (m_ardito)
Date: 2013-01-25 01:51

Message:
that didn't work... i still get the "Adblocker activated? No problem. But
please notice that HeidiSQL balances its
expenses with ads. This way, HeidiSQL stays free for everyone on the world,
including the low tech areas of the third world. Probably you want to
donate." alternative header...

here is my filter
-------------------------------------------------
FILTER: heidisql Consente banner per heidisql.com
s@googlesyndication\.com/@$0PRIVOXY-FORCE/@g
-------------------------------------------------

here is my rule
-------------------------------------------------
{ +filter{heidisql} }
.heidisql.com
-------------------------------------------------

here is how privoxy looks the page loading:
-------------------------------------------------
Matches for http://www.heidisql.com/:
In file: match-all.action View
{+change-x-forwarded-for{block}
+client-header-tagger{css-requests}
+client-header-tagger{image-requests}
+hide-from-header{block}
+set-image-blocker{pattern} }
/
In file: default.action View
(no matches in this file)
In file: user.action View
{-block
-filter{banners-by-size}
-filter{banners-by-link} }
.heidisql.com
{+filter{heidisql} }
.heidisql.com
-------------------------------------------------

what could be wrong?

----------------------------------------------------------------------

Comment By: Fabian Keil (fabiankeil)
Date: 2013-01-24 08:32

Message:
You are using "/" as delimiter in your pcrs command, but don't escape it in
places where it refers to the character.
$1 refers to the first character group, but you don't use any parentheses
to group characters.

Try something like this instead:
s@googlesyndication\.com/@$0PRIVOXY-FORCE/@g

Using @ as delimiter make it unnecessary to escape slashes. $0 refers to
the whole text that is matched.

The idea isn't to have Privoxy modify the URL in the GET request, but to
modify the URL on the page where you want to allow the ads, so the browser
itself sends the modified URL.

----------------------------------------------------------------------

Comment By: m.ardito (m_ardito)
Date: 2013-01-23 06:14

Message:
here are the steps that i think to follow, am i in the right direction? i
am using firebug to see ulrs and requests.

1) i created a user.filter "allowgooglesyndication" which (tries to)
replaces "http://pagead2.googlesyndication.com/pagead/show_ads.js" in the
GET request 
with 
"http://pagead2.googlesyndication.com/PRIVOXY-FORCE/pagead/show_ads.js"

i am using the "regex coach" program to check my regexp, this seems to
work,here,

s/.*googlesyndication\.com/$1"/PRIVOXY-FORCE"/sg

but i have no exerience with substitutions patterns... and i don't know if
it is valid for privoxy... 

2) create a user.action that enforce that filter for ".heidisql.com"
domain, like
{ +filter{allowgooglesyndication} }
.heidisql.com

3) i don't really understand if this setup will work because i feel like
privoxy applies that filter only to GET requests related to .heidisql.com,
as i see in http://config.privoxy.org/show-url-info?url=www.heidisql.com
that the filter is picked up by the action, but i am missing how tat
request can catch the googlesyndication pattern..?!? 

is there any kind of similar example i can learn from?

Thanks, Marco

----------------------------------------------------------------------

Comment By: m.ardito (m_ardito)
Date: 2013-01-23 04:46

Message:
you're right it was that domain, i can't figure out why i tried with that
domain... i will try the first method you suggest, because there are a
bunch of project i really wish to support in this way, i'll report here if
i succeeed or not... :-)  thanks.

----------------------------------------------------------------------

Comment By: Fabian Keil (fabiankeil)
Date: 2013-01-22 05:37

Message:
Looks like www.heidisql.com is using the URL
http://pagead2.googlesyndication.com/pagead/show_ads.js so I'm not sure why
you tried unblocking .googleadservices.com.

To only unblock the URL when it is used on  www.heidisql.com, you could use
a filter to insert a force prefix into the path. 

The default force prefix is "/PRIVOXY-FORCE" and you can check it at
http://config.privoxy.org/show-status.

Obviously this only works if you are not enforcing blocks:
http://config.privoxy.org/user-manual/config.html#ENFORCE-BLOCKS

You could also tag the requests with the Referer header and use the tag to
unblock the requests, but it's a bit more work and will only work if your
browser is sending the Referer header.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=460288&aid=3601646&group_id=11118

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.