@duckduckgo/autoconsent 16.42.0 → 16.43.1

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.
@@ -157,6 +157,24 @@
157
157
  });
158
158
  return true;
159
159
  },
160
+ EVAL_SOURCEPOINT_RESTORE_SCROLL: () => {
161
+ const root = document.documentElement;
162
+ const saved = root.dataset.previousScrollY;
163
+ if (saved && saved !== "null") {
164
+ root.dataset.previousScrollY = "null";
165
+ const y = -parseInt(saved, 10);
166
+ if (y > 0 && window.scrollY === 0) {
167
+ const behavior = root.style.scrollBehavior;
168
+ root.style.scrollBehavior = "auto";
169
+ window.scrollTo(0, y);
170
+ root.style.scrollBehavior = behavior;
171
+ }
172
+ }
173
+ window.addEventListener("pagehide", () => {
174
+ if (root.dataset.previousScrollY) root.dataset.previousScrollY = "null";
175
+ });
176
+ return true;
177
+ },
160
178
  EVAL_STEAMPOWERED_0: () => JSON.parse(
161
179
  decodeURIComponent(
162
180
  document.cookie.split(";").find((s) => s.trim().startsWith("cookieSettings")).split("=")[1]