Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switching between strictness levels confuses menu #42

Closed
jsamuel opened this issue Dec 22, 2011 · 2 comments
Closed

switching between strictness levels confuses menu #42

jsamuel opened this issue Dec 22, 2011 · 2 comments

Comments

@jsamuel
Copy link
Member

jsamuel commented Dec 22, 2011

imported trac ticket
created: 2009-10-03 19:02:59
reporter: justin

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.
  2. 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.

@jsamuel
Copy link
Member Author

jsamuel commented Dec 22, 2011

imported trac comment
created: 2009-10-03 21:41:52
author: justin

Fixed in r290.

We clear the allowed/rejected data rather than try to fix it up because there really is no way to fix it up correctly based on a new strictness level without trying to apply whitelist rules and other funkiness.

Also added a description of the Strictness setting in the preferences menu and an attempt to warn about the menu being cleared when it is changed. I'm not sure the text is the best, but it's hard to convey these ideas concisely.

@jsamuel
Copy link
Member Author

jsamuel commented Dec 22, 2011

imported trac comment
created: 2009-10-05 09:14:18
author: justin

Note: I've ignored the other issue that could be involved here from the complaint which is that !RequestPolicy doesn't generally make use of old rules when switching strictness. This is a bigger issue which will need to be addressed later. There's no trivial fix at this point. E.g., if a user whitelists yahoo.com -> yimg.com at "base domain" strictness and then switches to "full domain" stictness, this rule will match (and only match) requests from yahoo.com -> yimg.com still, not www.yahoo.com -> whatever.yimg.com. When determined to be important enough, a separate ticket will need to be opened about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant