RequestPolicy/requestpolicy — Issue #42: switching between strictness levels confuses menu
Author: jsamuel
Created: 2011-12-22 04:58:32+00:00
State: open
Labels: extension

If one switches between different strictness levels (e.g. "base domain" -> "full domain") the menu for currently opened sites will be wonky. It is possible that items show up that shouldn't and submenus for listed items don't exist. This caused version 0.5.9 submitted to AMO to be rejected:

Hi Justin,
please excuse that I have to refuse this version, it seems that it gets easily confuse on domain rules. I started testing with importing some of the default rules, removed them later, changed to full domain style and allowed youtube.com requests to ytimg.com. I guess your extension can't distinguish if it is a domain or host rule and switching the rule style confuses it. I switched backed to basic domain style and had ytimg.com listed under allowed requests, removed this, but the item is still there, no without the submenu (and other hosts of ytimg.com like i.ytimg.com still show up under the forbidden one).

There are two possible approaches I see for when the user changes strictness levels:
1. Go through and fix up the _rejectedRequests and _allowedRequests objects based on the new strictness level, resulting in the menu working normally after the change.
1. Just clear out the _rejectedRequests and _allowedRequests objects, resulting in the menu not having anything in it for already-open sites.

I should try to do the the first one, and if there are unexpected difficulties then just do the second. This is just not a common enough use case to worry about a little odd behavior given the number of more important outstanding features and bugs.