Consent-O-Matic icon indicating copy to clipboard operation
Consent-O-Matic copied to clipboard

Feature suggestion: Custom rules without debug output

Open robot3498712 opened this issue 2 years ago • 8 comments

Trying to write my first custom rule, a minimal use case, I noticed there isn't any debug output available, which isn't helpful. Indication "keep running on " is useless since it appears for all open tabs (matching or not).

The extension should offer some guidance:

  • any matching rule?
  • parsing errors on loading lists/rules
  • show total count of rules added/updated
  • show feedback on manual update
  • and ideally a debug log (on demand)

Right now it's pretty much fishing in the dark, and I'm used to manipulating the DOM.

robot3498712 avatar Sep 17 '22 08:09 robot3498712

There is a secret debug menu, see this post for info:

https://github.com/cavi-au/Consent-O-Matic/issues/81#issuecomment-1172853185

We should probably make it less hidden.

dkgof avatar Sep 17 '22 08:09 dkgof

Thanks a lot dkgof. Found it now. For some odd reason the button renders "hidden" on my firefox (screenshot attached).

debug

robot3498712 avatar Sep 17 '22 10:09 robot3498712

Is there a problem with adding custom URLs? I always get debug output "ConsentEngine loaded 0 of 0 rules". Tried about everything I can think of (including serving a copy of the default list). My rules.json is not hosted on github.

I reckon we need feedback on clicking the "Update Rules Now" button. Plus perhaps a button "clear all caches".

Thanks for your efforts!

robot3498712 avatar Sep 17 '22 12:09 robot3498712

I just tried hosting a small sample rule somewhere, and it works for me :/

Could you perhaps share the rule you are trying to fetch, or even the link? (Or maybee put the rule somewhere like pastebin to test)

dkgof avatar Sep 20 '22 07:09 dkgof

I tried hosting my small test rule on pastebin, so you can test:

https://pastebin.com/raw/AkduXvrE

dkgof avatar Sep 20 '22 08:09 dkgof

Thanks dkgof, appreciate your help. Tried the link you posted in my default firefox, and a non-modified firefox without any other extensions. Tried putting the rule, the rule list (also hosted on pastebin: https://pastebin.com/raw/WFmUbFca), and both.

Find the screenshots here - it always says 0 loaded.

Screenshot - 20220920113223 Screenshot - 20220920113237

robot3498712 avatar Sep 20 '22 09:09 robot3498712

I think i managed to pinpoint the problem.

It seems that pastebin raw, does not include "Access-Control-Allow-Origin" header, so the browser is blocking access to the list because of CORS.

Apparently this is not the behaviour in Chrome.

The default list served from github raw, does have the header and that is why its working.

dkgof avatar Sep 20 '22 10:09 dkgof

Thanks so much, that's exactly it.

Consent-O-Matic (nginx)

        location ~ ^/pub/COM/(.*)$  {
                location ~ \.json$ {
                        access_log      /dev/null;
                        error_log       /dev/null;
                        add_header      Access-Control-Allow-Origin *;
                        types { } default_type "text/plain; charset=utf-8";
                }
        }

robot3498712 avatar Sep 20 '22 10:09 robot3498712

The dev menu is a bit more visible now and it seems like the CORS fetching issue was resolved, so I'll close this issue

svnhub avatar Mar 05 '24 11:03 svnhub