Add new redirect — 'tagcommander-tc'
There is a generic exception for this script (@@||tagcommander.com^*/tc_$script), so maybe it would be a good idea to create a redirect resource for it.
Examples: https://github.com/AdguardTeam/AdguardFilters/issues/102818 (Broken video player) https://github.com/AdguardTeam/AdGuardSDNSFilter/issues/776 (Broken Sign in button)
To reproduce add this rule to user rules:
||cdn.tagcommander.com/*/tc_*.js$script,redirect=noopjs,important
Something like this should fix both issues:
window.tC = {
privacy: {
getOptinCategories: function () {},
cookieData: [],
},
addConsentChangeListener: function () {},
removeConsentChangeListener: function () {},
container: {
reload: function () {}
}
};
window.tc_events_global = function() {};
but I guess that it needs more tweaks.
Hello @AdamWr / @stanislav-atr, :wave:
Thank you very much for your work, both of you. :thumbsup:
About Status: In Review, here is mine. :relaxed:
Click to see my review …
:white_check_mark: MYTF1 case (www.tf1.fr)
Click to reveal …
Works perfectly! :heavy_check_mark:
And, as this is a large and highly modular website (web app), based on your work, here is a working version with bonus support for … AdGuard products without $redirect support:
# ⚠️ Current warning: see this issue related to "advanced rules" with "www." on iOS.
||cdn.tagcommander.com/*/tc_TF1_*.js$script,redirect=tagcommander-tc,important
!+ PLATFORM(ios, ext_safari)
www.tf1.fr#%#AG_defineProperty('__TF1_CONFIG__.thirdparty.tagco.url', { get: function() { return "data:application/javascript,window.tC={privacy:{getOptinCategories:function(){return['4','10001','10003','10004','10005','10006','10007','10008','10009','10010','10011','10012','10013','10014','10015','10016','10017','10018','10019','10020','13001','13002',];},cookieData:[],},addConsentChangeListener:function(){},removeConsentChangeListener:function(){},container:{reload:function(){}}};window.tc_events_global=function(){};"; } });
! ↳ or in the future¹ …
!www.tf1.fr#%#//scriptlet("agtrusted-set-constant", "__TF1_CONFIG__.thirdparty.tagco.url", "data:application/javascript,[…]")
¹ If both Scriptlets#137 + Scriptlets#65 — due to the existing stuff — are implemented.
See the context … (click to unfold)
:arrow_right: window.__TF1_CONFIG__.thirdparty.tagco:
:information_source: Set .enabled to false is not a working solution.
:information_source: My (future) PR will also include the same principle for embedUrl, though it's not required currently.
(Example with a video: via the main page the whatever URL set needs to be reachable while not required via its embed version.)
Another more global possibility … (click to unfold)
# Disadvantage of this global solution:
#
# Even when "agtrusted-set-constant" will be available, a JS rule will still be required …
# (which is a problem, due to Manifest V3 …)
||cdn.tagcommander.com^*/tc_$script,redirect=tagcommander-tc,domain=domain1|domain2|domainN,important
!+ PLATFORM(ios, ext_safari)
domain1,domain2,domainN#%#window.tC=[…];window.tc_events_global=[…];
!°---------------------------------------------------------------------°°
! Required to have a valid request response for specific websites …
! (i.e. those performing a reachability test)
!°°---------------------------------------------------------------------°
!+ PLATFORM(ios, ext_safari)
www.tf1.fr#%#AG_defineProperty('__TF1_CONFIG__.thirdparty.tagco.url', { get: function() { return "data:application/javascript,"; } });
! ↳ or in the future …
!www.tf1.fr#%#//scriptlet('agtrusted-set-constant', '__TF1_CONFIG__.thirdparty.tagco.url', 'data:application/javascript,')
:gear: Other popular TF1 case | LCI (www.lci.fr)
Click to reveal …
Example: https://www.lci.fr/direct
||cdn.tagcommander.com/4509/tc_LCI_23.js$script,redirect=noopjs,important
||cdn.tagcommander.com/4509/tc_LCI_25.js$script,redirect=noopjs,important
www.lci.fr#%#window.tC=[…];window.tc_events_global=[…];
:information_source: Two files loaded here (about them), but I note that either one or the other can be blocked but not both (when tested without injecting any JavaScript code).
:information_source: Even when trying to fix these two + one errors, I still have this for my part.
Example of change tested: privacy:{ getConsent:function(){return {consent:{status:'all-on'}};},[…]
:information_source: Also tried some stuff with tC.internalvars.ConsentString …
In relation with: if(!window.__tcfapi&&tC.internalvars.ConsentString===""){return retry++;}
:bulb: view-source:https://www.lci.fr/direct > search for const {consent} = tC.privacy.getConsent()
:eyes: Also (problem limited to iOS only it seems, at least I can't reproduce this message on AG for Windows/Android): https://github.com/AdguardTeam/AdguardFilters/issues/106222
:gear: Other non-popular TF1 case | JPPTV (www.jpptv.fr)
Click to reveal …
Example: https://www.jpptv.fr/video/les-sculpteurs-de-glace-reunis-a-valloire-13848850 (link go to the home page but you will be redirected to this video page once logged in with your MYTF1 account)
This is a prerequisite (in the current state):
@@||cdn.trustcommander.net/privacy$domain=jpptv.fr|cdn.trustcommander.net
Otherwise we have this and clicking on the sentence does nothing.
:information_source: Note that for some reason, once this rule is added, it seems to break the style a bit, but never mind: we can now click on the sentence and enable "Mesure d'audience" as requested because required to have the video play.
||cdn.tagcommander.com/5418/tc_JPPTV_21.js$script,redirect=noopjs,important
www.jpptv.fr#%#window.tC=[…];window.tc_events_global=[…];
:arrow_right_hook: The current solution doesn't work on this website either, unfortunately. (When used, the result is the same as at the very beginning, i.e. "we have this and clicking on the sentence does nothing.")
Many thanks in advance if you can look to make the last two websites work as well. 🙂
[ 🔧 EDIT 1-3: minor changes only. ]
@stanislav-atr Note that www.lci.fr is now www.tf1info.fr (very recent change). With a now unique https://cdn.tagcommander.com/6138/tc_TF1INFO_20.js file. :wink:
:arrow_right_hook: See also: https://github.com/AdguardTeam/AdguardFilters/issues/108132 (issue) / https://github.com/AdguardTeam/AdguardFilters/pull/108191 (PR).
@stanislav-atr :wave: Stanislav. When you have time, could you take a look at both TF1 INFO (ex.) and JPP TV (ex.)?
For these two, after a while, I managed to remove any error but it still doesn't work …
P.S. Too bad some parts are not named the same way (i.e. where one will use container_6138_20, the other will use container_5418_21 for example).
Thank you very much!
- :information_source: TF1 INFO has more audience than the other (therefore to be prioritized).
- :heavy_check_mark: Generally speaking, for these two, if deemed too complex in comparison to the audiences, the main thing remains to have managed to make MYTF1 in particular work (with the current existing stuff) [although, regarding MYTF1, they seem very recently to be content with a simple 500 error for the
tc_TF1_26.jsfile without anything else, but probably temporarily]. :thumbsup: