AdguardTeam / AdguardTeam/CoreLibs

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

Abierto
#2,071 0 comentarios 1 reacción 1 asignado Reclamado por @sfionov Ver en GitHub
Feature request Priority: P4 Version: CoreLibs v1.24
Lenguaje dominante
Sin datos de lenguaje
Estrellas
52
Forks
10
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### 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_

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.