Title: AdBlock   UK Cookie Consent breaks JavaScript
Last modified: August 22, 2016

---

# AdBlock UK Cookie Consent breaks JavaScript

 *  [Chris Trynkiewicz (Sukces Strony)](https://wordpress.org/support/users/eclare/)
 * (@eclare)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/adblock-uk-cookie-consent-breaks-javascript/)
 * Hi,
 * I’ve noticed that AdBlock (for Chrome) now blocks this plugin, which is OK. The
   plugin tries to execute a function, that is not defined though, which breaks 
   further execution of JavaScript.
 * Here’s the code that’s currently added to wp_footer():
 *     ```
       jQuery(document).ready(function(){
       			if(!catapultReadCookie("catAccCookies")){//If the cookie has not been set
       				jQuery("#catapult-cookie-bar").show();
       							}
       		});
       ```
   
 * This should work (didn’t test it though):
 *     ```
       jQuery(document).ready(function(){
       			if(typeof catapultReadCookie === 'function' && !catapultReadCookie("catAccCookies")){//If the cookie has not been set
       				jQuery("#catapult-cookie-bar").show();
       							}
       		});
       ```
   
 * Please test this and push out an update 🙂
 * [https://wordpress.org/plugins/uk-cookie-consent/](https://wordpress.org/plugins/uk-cookie-consent/)

Viewing 1 replies (of 1 total)

 *  [Mirek_PL](https://wordpress.org/support/users/mirek_pl/)
 * (@mirek_pl)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/adblock-uk-cookie-consent-breaks-javascript/#post-5860512)
 * thx for sharing

Viewing 1 replies (of 1 total)

The topic ‘AdBlock UK Cookie Consent breaks JavaScript’ is closed to new replies.

 * ![](https://ps.w.org/uk-cookie-consent/assets/icon.svg?rev=2567699)
 * [Termly - GDPR/CCPA Cookie Consent Banner](https://wordpress.org/plugins/uk-cookie-consent/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/uk-cookie-consent/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/uk-cookie-consent/)
 * [Active Topics](https://wordpress.org/support/plugin/uk-cookie-consent/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/uk-cookie-consent/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/uk-cookie-consent/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mirek_PL](https://wordpress.org/support/users/mirek_pl/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/adblock-uk-cookie-consent-breaks-javascript/#post-5860512)
 * Status: not resolved