{"action":"created","issue":{"url":"https://api.github.com/repos/gorhill/uMatrix/issues/673","repository_url":"https://api.github.com/repos/gorhill/uMatrix","labels_url":"https://api.github.com/repos/gorhill/uMatrix/issues/673/labels{/name}","comments_url":"https://api.github.com/repos/gorhill/uMatrix/issues/673/comments","events_url":"https://api.github.com/repos/gorhill/uMatrix/issues/673/events","html_url":"https://github.com/gorhill/uMatrix/issues/673","id":192434995,"number":673,"title":"[Question] How would you optimize this?","user":{"login":"levicki","id":16415478,"avatar_url":"https://avatars.githubusercontent.com/u/16415478?v=3","gravatar_id":"","url":"https://api.github.com/users/levicki","html_url":"https://github.com/levicki","followers_url":"https://api.github.com/users/levicki/followers","following_url":"https://api.github.com/users/levicki/following{/other_user}","gists_url":"https://api.github.com/users/levicki/gists{/gist_id}","starred_url":"https://api.github.com/users/levicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levicki/subscriptions","organizations_url":"https://api.github.com/users/levicki/orgs","repos_url":"https://api.github.com/users/levicki/repos","events_url":"https://api.github.com/users/levicki/events{/privacy}","received_events_url":"https://api.github.com/users/levicki/received_events","type":"User","site_admin":false},"labels":[{"id":299295375,"url":"https://api.github.com/repos/gorhill/uMatrix/labels/declined","name":"declined","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-11-29T23:47:10Z","updated_at":"2016-11-30T13:12:12Z","closed_at":"2016-11-30T03:26:29Z","body":"So, let's say I have a set of rules like this:\r\n```\r\n* * * block\r\n* 1st-party cookie allow\r\n* 1st-party css allow\r\n* 1st-party image allow\r\n* 1st-party other allow\r\n* 1st-party script allow\r\n* 1st-party xhr allow\r\n...\r\n// for blogspot.com to work I need this:\r\nblogspot.com blogblog.com image allow\r\nblogspot.com blogger.com css allow\r\nblogspot.com blogger.com frame allow\r\nblogspot.com blogger.com image allow\r\nblogspot.com blogger.com script allow\r\nblogspot.com google.com css allow\r\nblogspot.com google.com frame allow\r\nblogspot.com google.com xhr allow\r\nblogspot.com googleusercontent.com image allow\r\n\r\n// and with country redirects being popular also for blogspot.co.uk...\r\nblogspot.co.uk blogblog.com image allow\r\nblogspot.co.uk blogger.com css allow\r\nblogspot.co.uk blogger.com frame allow\r\nblogspot.co.uk blogger.com image allow\r\nblogspot.co.uk blogger.com script allow\r\nblogspot.co.uk google.com css allow\r\nblogspot.co.uk google.com frame allow\r\nblogspot.co.uk google.com xhr allow\r\nblogspot.co.uk googleusercontent.com image allow\r\n\r\n// and for blogspot.it...\r\nblogspot.it blogblog.com image allow\r\nblogspot.it blogger.com css allow\r\nblogspot.it blogger.com frame allow\r\nblogspot.it blogger.com image allow\r\nblogspot.it blogger.com script allow\r\nblogspot.it google.com css allow\r\nblogspot.it google.com frame allow\r\nblogspot.it google.com xhr allow\r\nblogspot.it googleusercontent.com image allow\r\n\r\n// and for blogspot.de...\r\nblogspot.de blogblog.com image allow\r\nblogspot.de blogger.com css allow\r\nblogspot.de blogger.com frame allow\r\nblogspot.de blogger.com image allow\r\nblogspot.de blogger.com script allow\r\nblogspot.de google.com css allow\r\nblogspot.de google.com frame allow\r\nblogspot.de google.com xhr allow\r\nblogspot.de googleusercontent.com image allow\r\n\r\n// and...\r\n```\r\nAnd I quickly get unmanageable rule list because I can't use regex (or at least some sort of wildcard) to have one set of rules for international domains of the same website. Instead of having to change rules only once for all countries I have to change them all to keep them all working.\r\n\r\n@gorhill You said regex is out of the question, any ideas how to handle this more efficiently?\r\n"},"comment":{"url":"https://api.github.com/repos/gorhill/uMatrix/issues/comments/263869881","html_url":"https://github.com/gorhill/uMatrix/issues/673#issuecomment-263869881","issue_url":"https://api.github.com/repos/gorhill/uMatrix/issues/673","id":263869881,"user":{"login":"levicki","id":16415478,"avatar_url":"https://avatars.githubusercontent.com/u/16415478?v=3","gravatar_id":"","url":"https://api.github.com/users/levicki","html_url":"https://github.com/levicki","followers_url":"https://api.github.com/users/levicki/followers","following_url":"https://api.github.com/users/levicki/following{/other_user}","gists_url":"https://api.github.com/users/levicki/gists{/gist_id}","starred_url":"https://api.github.com/users/levicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levicki/subscriptions","organizations_url":"https://api.github.com/users/levicki/orgs","repos_url":"https://api.github.com/users/levicki/repos","events_url":"https://api.github.com/users/levicki/events{/privacy}","received_events_url":"https://api.github.com/users/levicki/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T13:12:12Z","updated_at":"2016-11-30T13:12:12Z","body":"@gorhill \r\nCan you please point to where did I ask you to rewrite anything, much less from the ground up?\r\n\r\nI put the word \"question\" in the issue subject and I even specifically stated that I am aware you are against the regex and asked for alternatives.\r\n\r\nAll I wanted is to discuss how to handle issue with TLDs, and see if anyone has any good ideas, no need to get so defensive and rude about a simple question."}}
{"actor":{"display_login":"levicki"}}