Instead of this, just activate the filter in uBlock Origin: Filter Lists -> Annoyances -> EasyList Cookie
When it's needed for the website to work properly, it will automatically accept the cookie policy for you (sometimes it will accept all and sometimes only necessary cookie categories, depending on what's easier to do).