add inject code functionality

This commit is contained in:
Gianni Carafa
2023-11-03 22:27:55 +01:00
parent 96dd4de876
commit cde6ed7229
4 changed files with 83 additions and 20 deletions

View File

@@ -2,20 +2,24 @@
regexRules:
- match: <script\s+([^>]*\s+)?src="(/)([^"]*)"
replace: <script $1 script="/https://www.example.com/$3"
injectCode: |
<script>
window.localStorage.clear();
console.log("test");
</script>
- domain: www.anotherdomain.com
path: /article
googleCache: false
regexRules:
inject:
position: head # Position where to inject the code
code: |
<script>
window.localStorage.clear();
console.log("test");
alert("Hello!");
</script>
- domain: www.anotherdomain.com # Domain where the rule applies
path: /article # Path where the rule applies
googleCache: false # Search also in Google Cache
regexRules: # Regex rules to apply
- match: <script\s+([^>]*\s+)?src="(/)([^"]*)"
replace: <script $1 script="/https://www.example.com/$3"
injectCode: |
<script>
window.localStorage.clear();
console.log("test");
</script>
inject:
position: .left-content article .post-title # Position where to inject the code
code: |
<script>
window.localStorage.clear();
console.log("test");
</script>