reaja o URL da troca

window.history.pushState('a', 'New Page Title', `?search=${e.target.value}`);

// view.jsp?id=101
let queryString = window.location.search; 
let urlParams = new URLSearchParams(queryString);
let opportunity_id = urlParams.get('id');
Annoying Anteater