AdguardTeam / AdguardTeam/CoreLibs

Apply $removeparam rules to URLs updated via history.pushState / history.replaceState

Đang mở
#2,071 0 bình luận 1 reaction 1 người được giao Được @sfionov nhận Xem trên GitHub
Feature request Priority: P4 Version: CoreLibs v1.24
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
52
Fork
10
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Issue Details

`$removeparam` is currently applied to real network requests, but not to URLs changed client-side via `history.pushState` or `history.replaceState` in single-page applications. Because of this, on sites like VK Video and Yandex Market, tracking parameters may remain visible in the address bar after in-app navigation without a full page reload. The same parameters also remain in the URL when copied from the address bar. This leads to inconsistent behavior between regular navigations and SPA-driven URL updates. Reference: #2070

### Proposed solution

Extend `$removeparam` handling so that it is also applied when a page updates the current URL through `history.pushState` or `history.replaceState`, without requiring a real network request or full page reload. When a SPA writes a new URL to browser history, AdGuard should sanitize that URL using matching `$removeparam` rules before it is shown in the address bar and before it can be copied. The implementation should preserve normal SPA navigation behavior and be validated across supported products, including extensions, to ensure consistent behavior.

### Alternative solution

_No response_

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.