Skip to content

Commit 8745dc3

Browse files
Move out some examples into patching
1 parent 5ec0703 commit 8745dc3

File tree

1 file changed

+57
-37
lines changed

1 file changed

+57
-37
lines changed

features/scriptlets.json

Lines changed: 57 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,13 @@
66
"exceptions": [],
77
"settings": {
88
"scriptlets": [
9-
{
10-
"name": "trustedSetAttr",
11-
"attrs": {
12-
"selector": "a",
13-
"attr": "href",
14-
"value": "#"
15-
}
16-
},
17-
{
18-
"name": "setCookie",
19-
"attrs": {
20-
"domain": "example.com",
21-
"name": "test",
22-
"value": "accepted"
23-
}
24-
},
25-
{
26-
"name": "removeCookie",
27-
"attrs": {
28-
"domain": "example.com",
29-
"match": "bloop"
30-
}
31-
},
329
{
3310
"name": "setConstant",
3411
"attrs": {
3512
"property": "test",
3613
"value": "no"
3714
}
3815
},
39-
{
40-
"name": "trustedReplaceNodeText",
41-
"attrs": {
42-
"nodeName": "a",
43-
"textMatch": "More information...",
44-
"pattern": "...",
45-
"replacement": "!",
46-
"extraArgs": ["verbose"]
47-
}
48-
},
4916
{
5017
"name": "abortCurrentInlineScript",
5118
"attrs": {
@@ -69,12 +36,65 @@
6936
"conditionalChanges": [
7037
{
7138
"condition": {
72-
"type": "url",
73-
"url": {
74-
"match": "xnxx.com"
39+
"domain": "example.com"
40+
},
41+
"patchSettings": [
42+
{
43+
"op": "add",
44+
"path": "/scriptlets/-",
45+
"value": {
46+
"name": "trustedReplaceNodeText",
47+
"attrs": {
48+
"nodeName": "a",
49+
"textMatch": "More information...",
50+
"pattern": "...",
51+
"replacement": "!",
52+
"extraArgs": ["verbose"]
53+
}
54+
}
55+
},
56+
{
57+
"op": "add",
58+
"path": "/scriptlets/-",
59+
"value": {
60+
"name": "trustedSetAttr",
61+
"attrs": {
62+
"selector": "a",
63+
"attr": "href",
64+
"value": "#"
65+
}
66+
}
67+
},
68+
{
69+
"op": "add",
70+
"path": "/scriptlets/-",
71+
"value": {
72+
"name": "setCookie",
73+
"attrs": {
74+
"domain": "example.com",
75+
"name": "test",
76+
"value": "accepted"
77+
}
78+
}
79+
},
80+
{
81+
"op": "add",
82+
"path": "/scriptlets/-",
83+
"value": {
84+
"name": "removeCookie",
85+
"attrs": {
86+
"domain": "example.com",
87+
"match": "bloop"
88+
}
89+
}
7590
}
91+
]
92+
},
93+
{
94+
"condition": {
95+
"domain": "xnxx.com"
7696
},
77-
"changes": [
97+
"patchSettings": [
7898
{
7999
"op": "add",
80100
"path": "/scriptlets/-",

0 commit comments

Comments
 (0)