How to click an element without navigating away from the page

I would like to ask whether it is there a way for you to select an element without going to be navigate away,

I am new to coding , I trying to automate the unfollowing button. in instagram

unfolllow

let say I wanted to unfollow all by dbclick the “following” , can I just run my code on homepage URL?

https://www.instagram.com/_chaeboll/ — home page url
https://www.instagram.com/_chaeboll/following/ — after clicking following

const unfollow = document.querySelectorAll("following")

unfollow.forEach(() => { runing the code to click the button})
  • as the element isnt in home page , it will returned undefined, but i hope there is away when something happen in background which navigate away to the following URL and execute the code.

I know u can use the deobfuscate/debuggger to find the function which are called to do the action, but it is to advance for me to find the function

Im building it as extension in content.js

if there is isnt , is there any resources that teaches the process of automating things for me to learn more about finding the way to deobfuscate