'How to open different parameters in google search same tab using javascript?

I need to open different search parameter in google search same tab using java script.

No need to change http://google.com/search?q' in all time. I want show it in same tab when click search result.

let q = 'params';
// q = 123 or 213
window.open('http://google.com/search?q='+q ,'_blank');


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source