@duckduckgo/autoconsent 16.42.0 → 16.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/user-settings.json.TEMPLATE +22 -0
- package/CHANGELOG.md +16 -0
- package/dist/addon-firefox/background.bundle.js +18 -0
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +18 -0
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/background.bundle.js +18 -0
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +18 -0
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +18 -0
- package/dist/autoconsent.esm.js +18 -0
- package/dist/autoconsent.playwright.js +18 -0
- package/dist/autoconsent.standalone.js +19 -1
- package/dist/types/eval-snippets.d.ts +1 -0
- package/lib/eval-snippets.ts +20 -0
- package/package.json +1 -1
- package/readme.md +10 -0
- package/rules/autoconsent/sourcepoint-top.json +3 -2
- package/rules/compact-rules.json +1 -1
- package/rules/rules.json +1 -1
|
@@ -60,6 +60,7 @@ export declare const snippets: {
|
|
|
60
60
|
EVAL_SHOPIFY_TEST: () => boolean;
|
|
61
61
|
EVAL_SKYSCANNER_TEST: () => boolean | null;
|
|
62
62
|
EVAL_SIRDATA_UNBLOCK_SCROLL: () => boolean;
|
|
63
|
+
EVAL_SOURCEPOINT_RESTORE_SCROLL: () => boolean;
|
|
63
64
|
EVAL_STEAMPOWERED_0: () => boolean;
|
|
64
65
|
EVAL_TAKEALOT_0: () => boolean;
|
|
65
66
|
EVAL_TARTEAUCITRON_0: () => any;
|
package/lib/eval-snippets.ts
CHANGED
|
@@ -207,6 +207,26 @@ export const snippets = {
|
|
|
207
207
|
});
|
|
208
208
|
return true;
|
|
209
209
|
},
|
|
210
|
+
EVAL_SOURCEPOINT_RESTORE_SCROLL: () => {
|
|
211
|
+
// Sourcepoint scrolls back to this saved position when it unlocks; we unlock instead, so restore and clear it
|
|
212
|
+
const root = document.documentElement;
|
|
213
|
+
const saved = root.dataset.previousScrollY;
|
|
214
|
+
if (saved && saved !== 'null') {
|
|
215
|
+
root.dataset.previousScrollY = 'null';
|
|
216
|
+
const y = -parseInt(saved, 10);
|
|
217
|
+
if (y > 0 && window.scrollY === 0) {
|
|
218
|
+
const behavior = root.style.scrollBehavior;
|
|
219
|
+
root.style.scrollBehavior = 'auto';
|
|
220
|
+
window.scrollTo(0, y);
|
|
221
|
+
root.style.scrollBehavior = behavior;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// Sourcepoint re-locks after a bfcache restore, which autoconsent does not re-run for
|
|
225
|
+
window.addEventListener('pagehide', () => {
|
|
226
|
+
if (root.dataset.previousScrollY) root.dataset.previousScrollY = 'null';
|
|
227
|
+
});
|
|
228
|
+
return true;
|
|
229
|
+
},
|
|
210
230
|
EVAL_STEAMPOWERED_0: () =>
|
|
211
231
|
JSON.parse(
|
|
212
232
|
decodeURIComponent(
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -83,6 +83,16 @@ There are currently two ways of implementing a CMP:
|
|
|
83
83
|
|
|
84
84
|
For more details on rule types, see [Rule Syntax Reference](docs/rule-syntax.md).
|
|
85
85
|
|
|
86
|
+
## AI agent setup
|
|
87
|
+
|
|
88
|
+
The agent skills in `.agents/skills/` need a few environment variables.
|
|
89
|
+
|
|
90
|
+
1. Copy the contents from [`.claude/user-settings.json.TEMPLATE`](.claude/user-settings.json.TEMPLATE) to your user settings (e.g. `~/.claude/settings.json`), in addition to your existing config. If your settings already have an `env` block, merge the entries into it: a second `env` key would silently override the first.
|
|
91
|
+
2. Replace the values in the template. Proxy values must be complete URLs with an `http://`, `https://`, or `socks5://` scheme, and without embedded credentials. `REGIONAL_PROXY_USERNAME` and `REGIONAL_PROXY_PASSWORD` are optional: they are only used for `https://` proxies, so remove them if your proxies don't need authentication.
|
|
92
|
+
3. Start a new Claude Code session: settings are only read at startup.
|
|
93
|
+
|
|
94
|
+
For other agents or plain shell use, `export` the same variables in your shell profile instead.
|
|
95
|
+
|
|
86
96
|
## License
|
|
87
97
|
|
|
88
98
|
MPLv2.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sourcepoint-top",
|
|
3
3
|
"vendorUrl": "https://www.sourcepoint.com/",
|
|
4
|
-
"comment": "Top-frame companion to Sourcepoint-frame. The message UI lives in a cross-origin iframe, so the top frame cannot tell an ordinary notice from a 'consent or pay' wall that Sourcepoint-frame has to bail on; hide it either way and undo the scroll lock. Hiding uses visibility rather than display so the iframe keeps its layout and the frame rule can still complete a real rejection underneath, with z-index and pointer-events mirroring the built-in hide step. The scroll lock is undone twice over: removeClass restores each site's own layout in the normal case, and the stylesheet neutralises the lock declarations if Sourcepoint re-adds the class later (it does so on pageshow after a back/forward restore, which autoconsent does not re-run for).",
|
|
4
|
+
"comment": "Top-frame companion to Sourcepoint-frame. The message UI lives in a cross-origin iframe, so the top frame cannot tell an ordinary notice from a 'consent or pay' wall that Sourcepoint-frame has to bail on; hide it either way and undo the scroll lock. Hiding uses visibility rather than display so the iframe keeps its layout and the frame rule can still complete a real rejection underneath, with z-index and pointer-events mirroring the built-in hide step. The scroll lock is undone twice over: removeClass restores each site's own layout in the normal case, and the stylesheet neutralises the lock declarations if Sourcepoint re-adds the class later (it does so on pageshow after a back/forward restore, which autoconsent does not re-run for). Sourcepoint also saves the scroll position before locking and scrolls back to it when it unlocks: the eval step restores that position (the lock can clamp it to the top when a back navigation reloads the page) and clears it, so Sourcepoint does not later scroll to a stale value such as the top after a back/forward restore.",
|
|
5
5
|
"minimumRuleStepVersion": 3,
|
|
6
6
|
"runContext": {
|
|
7
7
|
"main": true,
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"stylesheet": "html.sp-message-open { height: auto !important; width: auto !important; } html.sp-message-open body { position: relative !important; overflow: auto !important; margin-top: 0 !important; top: auto !important; left: auto !important; right: auto !important; }",
|
|
21
21
|
"stylesheetId": "sourcepoint-top-scroll-unlock"
|
|
22
22
|
},
|
|
23
|
-
{ "removeClass": "sp-message-open", "selector": "html", "optional": true }
|
|
23
|
+
{ "removeClass": "sp-message-open", "selector": "html", "optional": true },
|
|
24
|
+
{ "eval": "EVAL_SOURCEPOINT_RESTORE_SCROLL", "optional": true }
|
|
24
25
|
]
|
|
25
26
|
}
|