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

Enable multiple domains to apply the same rule and add rules to ruleset #13

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

joncrangle
Copy link
Contributor

  1. Feat: allow multiple domains to use the same rule using the pipe operator as a delimiter
    This PR parses rule.Domain and splits by the "|" delimiter. This allows you to define several related domains to apply the same injections in ruleset.yaml. For instance:
- domain: www.architecturaldigest.com|www.bonappetit.com|www.cntraveler.com|www.epicurious.com|www.gq.com|www.newyorker.com|www.vanityfair.com|www.vogue.com|www.wired.com

This PR also adds rules to the ruleset for several domains.

@mms-gianni
Copy link
Contributor

Looks good. I'll need a moment to test it.

@mms-gianni mms-gianni changed the base branch from main to feature/multiplle-domains November 8, 2023 12:28
@mms-gianni
Copy link
Contributor

I'm wondering if this might be the better solution. Maybe even keep the "domain" for backward compatibility.

Pass domain as a string

- domain: www.example.com|www.beispiel.de|www.example.fr
  injections:
    - position: head # Position where to inject the code
      append: | 
        <script>
          window.localStorage.clear();
          console.log("test");
          alert("Hello!");
        </script>

Pass Domains as a list

- domains: 
  - www.example.com
  - www.beispiel.de
  - www.example.fr
  injections:
    - position: head # Position where to inject the code
      append: | 
        <script>
          window.localStorage.clear();
          console.log("test");
          alert("Hello!");
        </script>

@joncrangle
Copy link
Contributor Author

I agree that your option to pass domains as a list seems like a nicer API.

@mms-gianni mms-gianni merged commit 73b1391 into everywall:feature/multiplle-domains Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants