-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Order rulesets by names in popup, Fix #11986 #14678
Conversation
@cschanaj I tried this out in a browser at https://www.cnn.com and it seems to do the job, good work! I did not exhaustively test it, but here are some things I noticed:
I also have some minor code suggestions, such as: you should prefer |
f254015 takes care of my case-insensitivity and "main_frame" concerns, thanks! |
This would make it difficult to deactivate a ruleset in the list if resources are still being loaded. Often it will take a while for all resources to be loaded, and if the list is shifting while this is happening it will make it hard to click on the corresponding check box. This problem would be exacerbated by the fact that rulesets are now alphabetical rather than listed in the order they are requested, since previously the checkboxes were be added on to the end, which would not interfere with the position of existing checkboxes. I would leave off this change for now. We can deal with it separately in the future, but for this PR it seems like an orthogonal change. |
} else { | ||
this.active_tab_rules[tabId] = {}; | ||
this.active_tab_rules[tabId][ruleset.name] = ruleset; | ||
this.active_tab_rules.set(tabId, [ruleset,]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is strictly necessary. After all, https://github.com/EFForg/https-everywhere/pull/14678/files#diff-81d05cf2685349d7bbbe9f394bd74506R188 will simply override this value when the main_frame
is loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be necessary when there is no applicable ruleset applied to the main_frame
but at least one ruleset applied to the page resources; this is typical when a HTTP-only site serving third-parties HTTPS content.
@Hainish You make a good point about the difficulty of interacting with the checkboxes while the list is being loaded if the items are being shuffled around. Maybe there is some middle ground between the current approach of doing nothing, and making it fully real-time. In any case I agree it is unrelated to the change of making the rulesets alphabetical, and I'm okay with not requiring related changes in this particular pull request. |
@cschanaj I'm ready to merge, pending feedback on #14678 (comment) |
Thanks, @cschanaj. This looks great! |
EDIT: It seems that there can be more than 1Luckily, it doesn't matter because the earliermain_frame
rulesets, please do not merge yet.main_frame
rulesets do not perform rewrites. Otherwise, the sorting/ insertion logic would be over complicated given the advantages this enhancement can bring us.this PR makes rulesets shown in the popup sorted by names. Close #11986
Test performed (possibly more needed...)
CNN.com (partial)
shown on the top;TIME.com (partial)
NOT shown on the topYouTube
NOT shown on the top (preloaded?)stableRules
andunstableRules
Not sure if this should be introduced in the next release as well (given #14600).
cc @Hainish @J0WI @jeremyn @Bisaloo