Cimbali / CleanLinks

Converts obfuscated/nested links to genuine clean links.
https://addons.mozilla.org/en-GB/firefox/addon/clean-links-webext/
Mozilla Public License 2.0
76 stars 2 forks source link

Add an option for resetting rules which does NOT delete the custom rules. #112

Closed Rtizer-9 closed 4 years ago

Rtizer-9 commented 4 years ago

Recently I was modifying a particular rule and had to delete it but accidentally deleted one more rule which got selected after it.

Now, to bring that default rule the only option I had was to use "reset rules" which unfortunately also removes every custom rule. So an option which bring the default state of default rules WITHOUT interfering the custom rules would be of great help.

Cimbali commented 4 years ago

Hmmm. That does sound interesting.

Currently default vs. custom rules are identified as being (or not being) in the default rules file of the add-on, so I think this could easily be done.

In the mean time, here’s a little work-around to merge rules outside of CleanLinks with jq:

  1. export your current rules (before reset) to a.json
  2. reset rules
  3. export your default rules (after reset) to b.json
  4. merge files with jq -s '.[0] * .[1]' a.json b.json > c.json
  5. import c.json
Cimbali commented 4 years ago

I guess an “undo” button would fit your needs, and cover more use cases as well.

Cimbali commented 4 years ago

In the end I’ve also added a “Reset Default Rules” button.